OSDN Git Service

7e35ecde16d1b3e23d163b663a3c0ab4370709fa
[pf3gnuchains/gcc-fork.git] / gcc / cp / ChangeLog
1 2009-01-12  Jason Merrill  <jason@redhat.com>
2             Steve Ellcey  <sje@cup.hp.com>
3
4         PR c++/35109
5         * name-lookup.c (lookup_name_real): Keep looking past a hidden 
6         binding.
7
8 2009-01-12  Dodji Seketeli  <dodji@redhat.com>
9
10         PR c++/36019
11         * pt.c (parameter_of_template_p): New function.
12         * cp-tree.h: Declare it.
13         * name-lookup.c (binding_to_template_parms_of_scope_p): New
14         function.
15         (outer_binding): Take template parameters in account when looking for
16         a name binding.
17
18 2009-01-12  Jason Merrill  <jason@redhat.com>
19
20         PR c++/31488
21         * tree.c (pod_type_p): Return 1 for structs created by the back end.
22
23 2009-01-12  Jakub Jelinek  <jakub@redhat.com>
24
25         PR c/32041
26         * parser.c (cp_parser_builtin_offsetof): Allow `->' in
27         offsetof member-designator, handle it as `[0].'.
28
29         PR c++/38794
30         * decl.c (start_function): If grokdeclarator hasn't returned
31         FUNCTION_DECL nor error_mark_node, issue diagnostics.
32
33 2009-01-11  Jakub Jelinek  <jakub@redhat.com>
34
35         PR c++/36254
36         * cp-gimplify.c (genericize_if_stmt): Renamed from ...
37         (gimplify_if_stmt): ... this.
38         (cp_gimplify_expr): Don't handle IF_STMT here.
39         (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
40
41 2009-01-10  Andrew Pinski  <pinskia@gmail.com>
42
43         PR c++/38648
44         * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
45
46         PR c++/36695
47         * typeck2.c (build_functional_cast): Check for reference type and NULL
48         PARMS.
49
50 2009-01-09  Steve Ellcey  <sje@cup.hp.com>
51
52         * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
53
54 2009-01-09  Jakub Jelinek  <jakub@redhat.com>
55
56         PR c++/35335
57         * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
58
59 2009-01-09  John F. Carr  <jfc@mit.edu>
60
61         PR c++/37877
62         * parser.c (cp_parser_class_specifier): Clear
63         parser->in_unbraced_linkage_specification_p while parsing class
64         specifiers.
65
66 2009-01-07  Jakub Jelinek  <jakub@redhat.com>
67
68         PR c++/38725
69         * semantics.c (finish_goto_stmt): Convert destination to
70         void *.
71
72 2009-01-06  Jason Merrill  <jason@redhat.com>
73
74         PR c++/35297
75         PR c++/35477
76         PR c++/35784
77         PR c++/36846
78         PR c++/38276
79         * pt.c (check_default_tmpl_args): Don't complain about
80         out-of-order parameter packs in the enclosing class
81         or parameter packs after default args.
82         (coerce_template_parms): If we have more than one
83         parameter pack, don't flatten argument packs.
84         (template_args_equal): Handle argument packs.
85         (comp_template_args): Don't flatten argument packs.
86         (check_instantiated_arg): Split out from...
87         (check_instantiated_args): Here.  Handle arg packs.
88         (convert_template_argument): Just check that nontype argument
89         packs have the right type.
90
91 2009-01-05  Dodji Seketeli  <dodji@redhat.com>
92
93         PR c++/38472
94         * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
95
96 2009-01-05  Jason Merrill  <jason@redhat.com>
97
98         PR c++/38698
99         * typeck2.c (process_init_constructor_union): Handle union with
100         no fields.
101
102         * mangle.c (write_expression): Remove mangling for zero-operand
103         casts.
104
105         PR c++/38701
106         * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
107         defaulting.
108
109         PR c++/38702
110         * class.c (defaultable_fn_p): Only operator== can be a copy
111         assignment operator.
112
113 2009-01-02  Jason Merrill  <jason@redhat.com>
114
115         PR c++/38698
116         * typeck2.c (process_init_constructor_union): Handle excess
117         initializers.
118         (process_init_constructor_record): Likewise.
119
120         PR c++/38684
121         * typeck2.c (digest_init_r): Don't use process_init_constructor
122         for non-aggregate classes.
123
124 2008-12-31  Jakub Jelinek  <jakub@redhat.com>
125
126         PR c++/38647
127         * parser.c (cp_parser_primary_expression) <case RID_FUNCTION_NAME>:
128         Return error_mark_node if cp_parser_non_integral_constant_expression
129         returns true.
130
131         PR c++/38640
132         * semantics.c (finish_decltype_type): Handle TEMPLATE_PARM_INDEX.
133
134 2008-12-29  Jakub Jelinek  <jakub@redhat.com>
135
136         PR c++/38635
137         * parser.c (cp_parser_condition): Use cp_parser_require
138         instead of cp_lexer_consume_token to consume =.
139
140         PR c++/38637
141         * decl.c (start_enum): If enumtype is error_mark_node, exit early.
142
143 2008-12-28  Jakub Jelinek  <jakub@redhat.com>
144
145         PR c++/38650
146         * semantics.c (finish_omp_for): Don't add CLEANUP_POINT_EXPR
147         around volatile iteration var in condition and/or increment
148         expression.
149
150 2008-12-27  Jakub Jelinek  <jakub@redhat.com>
151
152         PR c++/38639
153         * pt.c (tsubst_omp_for_iterator): RECUR on whole init_expr instead of
154         just its type.
155
156 2008-12-21  Jason Merrill  <jason@redhat.com>
157
158         PR c++/38597
159         * name-lookup.c (arg_assoc_type): Handle DECLTYPE_TYPE.
160
161 2008-12-20  Jakub Jelinek  <jakub@redhat.com>
162             Manuel López-Ibáñez  <manu@gcc.gnu.org>
163
164         PR c++/36921
165         * c-common.c (warn_about_parentheses): Remove ARG_UNUSED from
166         arg_left.  Don't warn about X<=Y<=Z if comparison's type isn't
167         integral.
168
169 2008-12-19  Jakub Jelinek  <jakub@redhat.com>
170
171         PR c++/38577
172         * call.c (build_new_method_call): Handle call being COMPOUND_EXPR
173         or NOP_EXPR.
174
175 2008-12-18  Jakub Jelinek  <jakub@redhat.com>
176
177         PR c++/38427
178         * init.c (perform_member_init): For value-initialized
179         references call permerror instead of warning and don't emit any
180         INIT_EXPR.
181
182 2008-12-18  Jason Merrill  <jason@redhat.com>
183
184         PR c++/38485
185         * parser.c (cp_parser_token_starts_cast_expression): An EOF
186         can't start a cast-expression.
187
188 2008-12-17  Jason Merrill  <jason@redhat.com>
189
190         * semantics.c (describable_type): New function.
191         (finish_decltype_type): Use it for dependent exprs.
192         * cp-tree.h: Declare it.
193         * mangle.c (write_type) [DECLTYPE_TYPE]: Set skip_evaluation.
194         (write_expression): If skip_evaluation, use type stubs.
195         * tree.c (cp_tree_equal): Handle PARM_DECLs from different
196         declarations of a function.
197         * init.c (build_new): Do auto deduction if type is describable.
198         * decl.c (cp_finish_decl): Likewise.
199         * parser.c (cp_parser_omp_for_loop): Likewise.
200
201 2008-12-10  Jason Merrill  <jason@redhat.com>
202
203         PR c++/35319
204         * mangle.c (write_builtin_type): Add mangling for decimal floating 
205         point and fixed point types.
206         (write_type): Pass FIXED_POINT_TYPE along.
207
208 2008-12-09  Mark Mitchell  <mark@codesourcery.com>
209
210         PR c++/37971
211         * class.c (resolve_address_of_overloaded_function): Check
212         accessibility of member functions unless FLAGS indicates
213         otherwise.
214         * call.c (standard_conversion): Adjust flags passed to
215         instantiate_type.
216         (convert_default_arg): Do not perform access checks.
217         * cp-tree.h (tsubst_flags_t): Add tf_no_access_control.
218
219 2008-12-08  Steve Ellcey  <sje@cup.hp.com>
220
221         * decl2.c (mark_used): Remove assemble_external call.
222
223 2008-12-08  Dodji Seketeli  <dodji@redhat.com>
224
225         PR debug/38390
226         * name-lookup.c (kept_level_p): Don't forget the case of levels
227           having using directives.
228
229 2008-12-08  Richard Henderson  <rth@redhat.com>
230
231         PR 38240
232         * class.c (finish_struct_bits): Use SET_TYPE_MODE.
233         * decl.c (record_unknown_type): Likewise.
234         (start_enum, finish_enum): Likewise.
235
236 2008-12-05  Jakub Jelinek  <jakub@redhat.com>
237
238         PR c++/35336
239         * error.c (dump_expr): Handle BIT_FIELD_REF.
240
241 2008-12-05  Sebastian Pop  <sebastian.pop@amd.com>
242
243         PR bootstrap/38262
244         * Make-lang.in (cc1plus-dummy, cc1plus): Add BACKENDLIBS,
245         remove GMPLIBS.
246
247 2008-12-04  Jason Merrill  <jason@redhat.com>
248
249         PR c++/37906
250         * decl.c (grok_special_member_properties): Set TYPE_HAS_COMPLEX_DFLT
251         here.
252         * class.c (check_bases_and_members): Rather than assuming any
253         user-declared default constructor is complex here.
254
255 2008-12-04  Richard Guenther  <rguenther@suse.de>
256
257         PR c++/38334
258         * typeck.c (get_member_function_from_ptrfunc): Mark the vtbl
259         pointer access with TREE_NO_WARNING.
260
261 2008-12-03  Jason Merrill  <jason@redhat.com>
262
263         PR c++/38232
264         * init.c (build_value_init): Do initial zero-initialization
265         of a class with an implicitly-defined constructor using
266         build_zero_init rather than in build_value_init.
267         (build_value_init_1): Fold into build_value_init.
268
269         PR c++/38256
270         * parser.c (cp_parser_conversion_type_id): Diagnose
271         'operator auto' here.
272         * decl.c (grokdeclarator): Not here.
273
274         PR c++/38380
275         * decl.c (grokdeclarator): Only set DECL_NONCONVERTING_P
276         on explicit constructors.
277         * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Propagate
278         CONSTRUCTOR_IS_DIRECT_INIT.
279
280 2008-12-02  Jason Merrill  <jason@redhat.com>
281
282         PR c++/35782, c++/37860
283         * call.c (build_user_type_conversion_1): Remember
284         list-initialization.
285         (convert_like_real): Likewise.
286         (build_over_call): Don't require the copy constructor
287         for copy-list-initialization.
288         * cp-tree.h (TARGET_EXPR_LIST_INIT_P): New macro.
289
290         PR c++/37234
291         * decl.c (cp_finish_decl): Handle =default and =delete for
292         templates, too.
293
294 2008-12-01  Jakub Jelinek  <jakub@redhat.com>
295
296         PR c++/38257
297         * parser.c (cp_parser_omp_for_loop): Handle auto.
298         * pt.c (tsubst_omp_for_iterator): Likewise.
299
300 2008-11-28  Jason Merrill  <jason@redhat.com>
301
302         PR c++/38233
303         * init.c (perform_member_init): Fix value-initialization.
304         (build_value_init_1): Add assert to catch cases that will break
305         in the gimplifier.
306         (build_default_init): Remove.
307         * cp-tree.h: Remove its prototype.
308         * pt.c (tsubst_expr) [DECL_EXPR]: Use build_value_init for
309         value-initialization.
310
311         PR c++/38278
312         * parser.c (cp_parser_class_name): Only call 
313         maybe_note_name_used_in_class if we actually found a class name.
314
315 2008-11-25  Jason Merrill  <jason@redhat.com>
316
317         PR c++/28743
318         * decl2.c (check_classfn): Error rather than abort on parameter
319         list mismatch.
320
321 2008-11-20  Jason Merrill  <jason@redhat.com>
322
323         PR c++/28513
324         * parser.c (cp_parser_class_name): Call maybe_note_name_used_in_class.
325
326         PR c++/37540
327         * call.c (build_over_call): Take the address of the function even
328         in a template.
329         (build_new_method_call): Remember the type of the called function
330         in a template.
331
332 2008-11-19  Dodji Seketeli  <dodji@redhat.com>
333
334         PR c++/37142
335         * pt.c (coerce_template_template_parm): Use the more robust
336         uses_template_parms instead of dependent_type_p.
337
338 2008-11-19  Dodji Seketeli  <dodji@redhat.com>
339
340         PR c++/35405
341         * pt.c (lookup_template_class): Check pointers before dereferencing
342         them.
343         * error.c (dump_template_decl): Likewise.
344
345 2008-11-19  Jason Merrill  <jason@redhat.com>
346
347         PR c++/36410
348         * decl2.c (grokfield): Pass ATTR_FLAG_TYPE_IN_PLACE for a typedef
349         that names a class for linkage purposes.
350
351         PR c++/37563
352         * parser.c (cp_parser_pseudo_destructor_name): A pseudo-destructor
353         name is not a declaration.
354
355         PR c++/37256
356         * pt.c (instantiate_decl): Don't require a definition of
357         a template that is explicitly instantiated 'extern'.
358
359 2008-11-18  Jason Merrill  <jason@redhat.com>
360             Jakub Jelinek  <jakub@redhat.com>
361         
362         PR c++/37962
363         * parser.c (cp_parser_type_id): Complain about auto.
364         * decl.c (grokdeclarator): Complain about parameters and
365         conversion functions declared with auto.
366
367         * call.c (standard_conversion): Use CLASS_TYPE_P instead of
368         MAYBE_CLASS_TYPE_P.
369         * cp-tree.h (TYPE_NON_AGGREGATE_CLASS): Likewise.
370
371 2008-11-17  Jakub Jelinek  <jakub@redhat.com>
372
373         PR c++/36089
374         * init.c (constant_value_1): Handle TREE_LIST init.
375
376 2008-11-15  Jakub Jelinek  <jakub@redhat.com>
377
378         PR c++/37561
379         * typeck.c (cp_build_unary_op): Don't call get_unwidened.  Use
380         argtype instead of result_type.
381
382 2008-11-14  Jason Merrill  <jason@redhat.com>
383
384         PR c++/38030
385         * semantics.c (finish_call_expr): Don't repeat arg-dep lookup
386         for a non-dependent call.
387
388         PR c++/37740
389         * call.c (build_aggr_conv): Increment i.
390
391 2008-11-13  Jason Merrill  <jason@redhat.com>
392
393         PR c++/37932
394         * typeck2.c (process_init_constructor_record): Update bitfield
395         handling.
396         (check_narrowing): Update bitfield handling, print source type.
397         
398 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
399
400         PR c++/36478
401         Revert:
402         2007-05-07  Mike Stump  <mrs@apple.com>
403         * parser.c (check_empty_body): Add.
404         (cp_parser_iteration_statement): Add call to check_empty_body.
405
406 2008-11-12  Jason Merrill  <jason@redhat.com>
407
408         PR c++/38007
409         * typeck.c (cp_build_modify_expr): Update bitfield handling.
410
411 2008-11-12  Jakub Jelinek  <jakub@redhat.com>
412
413         PR c++/34269
414         * parser.c (cp_parser_simple_declaration): Don't commit
415         to tentative parse if parse errors were seen.
416
417         PR c++/35334
418         * error.c (dump_expr): Handle COMPLEX_EXPR.
419
420 2008-11-10  Jakub Jelinek  <jakub@redhat.com>
421
422         PR c++/38021
423         * parser.c (cp_parser_enum_specifier): After parsing :,
424         parse definitely.  Don't return early if type specifier
425         is erroneous.
426
427 2008-11-06  David Edelsohn  <edelsohn@gnu.org>
428
429         PR target/26397
430         * g++spec.c (LIBSTDCXX_STATIC): New.
431         (lang_spec_driver): Use LIBSTDCXX_STATIC when not
432         shared_libgcc.
433         
434 2008-11-05  Fabien Chene <fabien.chene@gmail.com>
435
436         PR c++/32519
437         * cp-tree.h: Fix DECL_NONSTATIC_MEMBER_P to handle member template
438         functions.
439
440 2008-11-05  Richard Guenther  <rguenther@suse.de>
441
442         PR middle-end/37742
443         * decl.c (start_preparsed_function): Use the correct type for
444         building the RESULT_DECL.
445
446 2008-10-31  Jakub Jelinek  <jakub@redhat.com>
447
448         PR c++/37967
449         * decl.c (grokdeclarator): Diagnose auto function decl without
450         late return type and late return type function decl where type
451         is not auto.
452
453         PR c++/37965
454         * decl.c (cp_finish_decl): Diagnose type_uses_auto type with
455         no initializer.
456
457 2008-10-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
458
459         PR 11492
460         * class.c (check_bitfield_decl): Rename min_precision to
461         tree_int_cst_min_precision.
462         * decl.c (finish_enum): Likewise.
463
464 2008-10-29  Manuel López-Ibáñez  <manu@gcc.gnu.org>
465
466         PR c++/26997
467         * parser.c (cp_parser_token_starts_cast_expression): New.
468         (cp_parser_cast_expression): Peek the next token to decide whether
469         this could be a parenthesized constructor or is definitely an
470         actual cast.
471
472 2008-10-24  Manuel López-Ibáñez  <manu@gcc.gnu.org>
473
474         PR c/7543
475         * typeck.c (build_x_binary_op): Update call to
476         warn_about_parentheses.
477         * parser.c (cp_parser_binary_expression): Add note about passing
478         the correct code for unary expressions.
479
480 2008-10-24  Jakub Jelinek  <jakub@redhat.com>
481
482         * Make-lang.in (check-c++-subtargets): New alias for
483         check-g++-subtargets.
484         (lang_checks_parallelized): Add check-g++.
485         (check_g++_parallelize): New variable.
486
487 2008-10-21  Richard Guenther  <rguenther@suse.de>
488
489         * semantics.c (simplify_aggr_init_exprs_r): Remove.
490         (expand_or_defer_fn): Do not walk the function body to
491         simplify aggr_init_exprs.
492
493 2008-10-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
494
495         PR c++/37004
496         * typeck.c (cp_common_type): New. The same as
497         type_after_usual_arithmetic_conversions but without promotions.
498         (type_after_usual_arithmetic_conversions): Do the promotions and
499         call cp_common_type.
500         (common_type): Make it behave like the C version of this
501         function. Do not handle pointer types.
502         (common_pointer_type): Move handling of pointer types from
503         common_type to here.
504         (cp_build_binary_op): Use common_pointer_type instead of
505         common_type in call to pointer_diff.
506         Use cp_common_type instead of common_type.
507         * cp-tree.h (common_pointer_type): Declare.
508
509 2008-10-14  Jakub Jelinek  <jakub@redhat.com>
510
511         PR c++/37819
512         * cp-gimplify.c (cp_genericize_r): Only fold_convert COND_EXPR
513         arguments if they don't already have COND_EXPR's type.
514
515 2008-10-14  Paolo Carlini  <paolo.carlini@oracle.com>
516
517         PR c++/37650
518         * pt.c (push_template_decl_real): Check that current_template_parms
519         is not null.
520         (process_partial_specialization): Assert current_template_parms not
521         null.
522
523 2008-10-13  Doug Evans  <dje@google.com>
524
525         * cp-tree.h (DECL_MAIN_P): Fix parentheses around expression.
526
527 2008-10-10  Jakub Jelinek  <jakub@redhat.com>
528
529         PR c++/37146
530         * cp-gimplify.c (cp_genericize_r): Fix up bitfield operands of
531         COND_EXPR.
532
533 2008-10-09  Jakub Jelinek  <jakub@redhat.com>
534
535         PR c++/37568
536         * semantics.c (finalize_nrv_r): Clear DECL_INITIAL instead of
537         setting it to error_mark_node.
538
539 2008-10-07  Steve Ellcey  <sje@cup.hp.com>
540
541         * decl.c (start_cleanup_fn): Declare as inline.
542
543 2008-10-06  Jason Merrill  <jason@redhat.com>
544
545         PR c++/37376, other mangling issues
546         * mangle.c (write_type): Update TYPE_PACK_EXPANSION mangling.
547         (write_member_name): Break out from...
548         (write_expression): ...here.  Handle dependent COMPONENT_REF.
549         (write_template_arg): Wrap an argument pack in 'I'/'E'.
550         (write_builtin_type): Update char16/32_t mangling.
551         (write_nested_name, write_prefix): Don't forget template args
552         for typename types.
553         * operators.def: Add ARROW_EXPR, update COMPONENT_REF and 
554         EXPR_PACK_EXPANSION.
555
556 2008-10-06  Aldy Hernandez  <aldyh@redhat.com>
557
558         * typeck.c (build_x_indirect_ref): Add location argument.
559         (cp_build_binary_op): Pass location to warn_for_div_by_zero.
560         (cp_build_unary_op): Add location argument.
561         (cp_build_modify_expr): Same.
562         * class.c (build_base_path): Pass location to build_indirect_ref.
563         * semantics.c (handle_omp_for_class_iterator): Pass elocus to
564         build_modify_expr.
565
566 2008-10-05  Dodji Seketeli  <dodji@redhat.com>
567
568         PR c++/37410
569         * cp-gimplify.c (cp_gimplify_expr): For each USING_STMT
570         make sure an IMPORTED_DECL node is added to the BLOCK_VARS list
571         of the innermost containing BLOCK.
572
573 2008-10-03  Paolo Carlini  <paolo.carlini@oracle.com>
574
575         PR c++/37719
576         * error.c (dump_function_decl): Save the exceptions in case of
577         error about incompatible specifications in a specialization.
578
579 2008-10-01  Andrew Pinski  <andrew_pinski@playstation.sony.com>
580
581         * tree.c (lvalue_p_1): COMPOUND_LITERAL_EXPR is also an lvalue.
582
583 2008-09-30  H.J. Lu  <hongjiu.lu@intel.com>
584
585         PR c++/37683
586         * parser.c (cp_parser_selection_statement): Fix uninitialized
587         variable.
588
589 2008-09-30  Simon Martin  <simartin@users.sourceforge.net>
590
591         PR c++/37555
592         PR c++/37556
593         * decl.c (grokdeclarator): Set the type for typedefs to a
594         nested-name-specifier to error_mark_node.
595
596 2008-09-30  Paolo Bonzini  <bonzini@gnu.org>
597
598         * parser.c (cp_parser_selection_statement): Implement here the
599         -Wempty-body warning for `if' and `else' statements.
600         * semantics.c (finish_if_stmt): Do not call empty_body_warning.
601
602 2008-09-25  Paolo Carlini  <paolo.carlini@oracle.com>
603
604         PR c++/37649
605         * name-lookup.c (maybe_process_template_type_declaration): Check
606         return value of push_template_decl_real for error_mark_node.
607
608 2008-09-24  Aldy Hernandez  <aldyh@redhat.com>
609
610         * semantics.c (finish_fname): Pass location to fname_decl.
611
612 2008-09-23  Jakub Jelinek  <jakub@redhat.com>
613
614         PR c++/37533
615         * semantics.c (finish_omp_for): If processing_template_decl, just build
616         MODIFY_EXPR for init instead of calling cp_build_modify_expr.
617
618 2008-09-23  Aldy Hernandez  <aldyh@redhat.com>
619
620         * typeck.c (build_array_ref): Pass location to cp_build_binary_op.
621         (get_member_function_from_ptrfunc): Same.
622         (build_x_binary_op): Same.
623         (build_binary_op): Same.
624         (cp_build_binary_op): New location argument.
625         (pointer_diff): Pass location to cp_build_binary_op.
626         (cp_truthvalue_conversion): Pass location to build_binary_op.
627         (convert_ptrmem): Pass location to cp_build_binary_op.
628         (cp_build_modify_expr): Same.
629         (build_ptrmemfunc): Same.
630         * init.c (expand_cleanup_for_base): Pass location to
631         c_common_truthvalue_conversion.
632         (build_new_1): Pass location to cp_build_binary_op.
633         (build_vec_delete_1): Pass location to *build_binary_op,
634         c_common_truthvalue_conversion.
635         (build_vec_init): Same.
636         (build_delete): Same.
637         * decl.c (compute_array_index_type): Same.
638         * call.c (build_new_op): Same.
639         * rtti.c (build_dynamic_cast_1): Same.
640         * cp-tree.h: Add argument to cp_build_binary_op.
641         * semantics.c (handle_omp_for_class_iterator): Pass location to
642         *build_binary_op, c_common_truthvalue_conversion.
643         * decl2.c (get_guard_cond): Same.
644
645 2008-09-17  Richard Guenther  <rguenther@suse.de>
646
647         PR c++/22374
648         * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
649         result to the correct type.
650
651 2008-09-17  H.J. Lu  <hongjiu.lu@intel.com>
652
653         PR c++/37450
654         * name-lookup.c (pushdecl_maybe_friend): Don't return the old
655         parameter for duplicate.
656
657 2008-09-17  Jason Merrill  <jason@redhat.com>
658
659         PR c++/37588
660         * name-lookup.c (lookup_type_scope): Look through sk_function_parms.
661
662 2008-09-17  Jakub Jelinek  <jakub@redhat.com>
663
664         PR c++/37552
665         * typeck.c (build_array_ref): Use protected_set_expr_location instead
666         of SET_EXPR_LOCATION when ret might not be an expression.
667
668 2008-09-17  Jan Hubicka  <jh@suse.cz>
669
670         PR c++/18071
671         * cp/decl.c (start_method): Set DECL_NO_INLINE_WARNING_P.
672
673 2008-09-16  Jakub Jelinek  <jakub@redhat.com>
674
675         PR c++/37531
676         * semantics.c (finish_compound_literal): Return error_mark_node if
677         type is errorneous.
678
679         PR c++/37532
680         * lex.c (init_reswords): Don't populate ridpointers for D_CONLY
681         reserved words.
682
683 2008-09-15  Aldy Hernandez  <aldyh@redhat.com>
684
685         * decl.c (duplicate_decls): Call error_at.
686         (grokfndecl): New location argument.  Use location if available.
687         (grokdeclarator): Pass declarator location to grokfndecl.
688         * cp-tree.h (struct cp_declarator): Update comment for id_loc.
689         * decl2.c (check_classfn): Use error_at.
690         * parser.c (cp_parser_init_declarator): Set function_start_locus
691         to brace location.
692         (cp_parser_member_declaration): Set id_loc for function declarators.
693
694 2008-09-09  Jan Hubicka  <jh@suse.cz>
695
696         PR middle-end/37500
697         * pt.c (tsubst_decl): Do not copy DECL_STRUCT_FUNCTION pointer.
698
699 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
700
701         PR c++/37417
702         * tree.c (array_type_nelts_top): Add size_one_node instead of
703         integer_one_node.
704
705 2008-09-09  Jason Merrill  <jason@redhat.com>
706
707         PR c++/37439
708         * pt.c (tsubst_copy) [PARM_DECL]: Don't abort if the parm has
709         DECL_CONTEXT set.
710
711 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
712
713         PR c++/37389
714         * decl.c (build_enumerator): Handle previous value's DECL_INITIAL
715         being error_operand_p.  Don't clear value if it was error_mark_node.
716
717 2008-09-09  Paolo Bonzini  <bonzini@gnu.org>
718
719         * cp-objcp-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
720         * cp-tree.h: Don't mention DECL_ANON_UNION_ELEMS.
721         * semantics.c (anon_aggr_type_p): Remove.
722
723 2008-09-06  Jason Merrill  <jason@redhat.com>
724
725         PR c++/37302
726         * parser.c (cp_parser_parameter_declaration_list): Process the
727         PARM_DECLs as we go and push them.  Return a TREE_LIST.
728         (cp_parser_parameter_declaration_clause): Return a TREE_LIST.
729         (cp_parser_direct_declarator): Create a binding level and
730         suppress deprecated warnings in the parameter list.
731         (make_call_declarator): PARMS is now a tree.
732         * cp-tree.h (struct cp_declarator): Function parms are now a tree.
733         * decl.h (enum deprecated_states, deprecated_state): Move here.
734         * decl.c: From here.
735         (type_is_deprecated): New fn.
736         (grokparms): PARMLIST is a tree now.  Warn about parms that
737         use deprecated types.
738         * mangle.c (write_expression): Handle PARM_DECL, CALL_EXPR and
739         0-operand cast.
740         * pt.c (tsubst) [DECLTYPE_TYPE]: Set skip_evaluation.
741         (tsubst_copy) [PARM_DECL]: Handle a PARM_DECL used outside of a 
742         function.
743         * name-lookup.c (pushtag): Look through function parameter scopes.
744         (pushdecl_maybe_friend): Don't set DECL_CONTEXT on a PARM_DECL 
745         when we're parsing a function declarator.
746
747 2008-09-05  Douglas Gregor  <doug.gregor@gmail.com>
748
749        PR c++/37342
750        * tree.c (cp_build_qualified_type_real): Deal with sharing of
751        TYPE_LANG_SPECIFIC in the canonical types of pointer-to-method
752        types.
753         
754 2008-09-04  Ian Lance Taylor  <iant@google.com>
755
756         * parser.c (check_no_duplicate_clause): Change code parameter to
757         enum omp_clause_code.
758
759 2008-09-03  Jakub Jelinek  <jakub@redhat.com>
760
761         PR c++/37348
762         * decl.c (cp_finish_decl): Only set
763         DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P if decl is VAR_DECL.
764
765         PR c++/37189
766         * cp-tree.h (defer_mark_used_calls, deferred_mark_used_calls): New
767         extern decls.
768         * decl2.c (mark_used): If defer_mark_used_calls, push decl into
769         deferred_mark_used_calls vector and exit early.
770         * decl.c (defer_mark_used_calls, deferred_mark_used_calls): New
771         variables.
772         (finish_function): Set defer_mark_used_calls for the duration of the
773         function.  Call mark_used on any queued decls.
774
775 2008-09-02  Jason Merrill  <jason@redhat.com>
776
777         PR c++/37208
778         * call.c (build_over_call): Make =delete work with SFINAE.
779         * class.c (resolve_address_of_overloaded_function): Likewise.
780
781         * cp-tree.h (struct lang_decl_flags): Rename threadprivate_p to
782         threadprivate_or_deleted_p.
783         (CP_DECL_THREADPRIVATE_P): Adjust.
784         (DECL_DELETED_FN): Likewise.
785         (SD_UNINITIALIZED, SD_INITIALIZED, SD_DEFAULTED): New macros.
786         (SD_DELETED): New macro.
787         * parser.c (cp_parser_init_declarator): Use them.
788         * decl.c (start_decl): Use them.
789
790         * decl2.c (mark_used): Give =deleted error even in sizeof.
791
792         * typeck2.c (check_narrowing): Downgrade narrowing error to
793         permerror.
794
795 2008-09-02  Aldy Hernandez  <aldyh@redhat.com>
796
797         * typeck.c (build_array_ref): Use new location argument.
798         * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
799         * call.c (build_new_op): Same.
800         * decl2.c (grok_array_decl): Same.
801         * cp-tree.h (build_array_ref): Add location argument to prototype.
802
803 2008-09-01  Aldy Hernandez  <aldyh@redhat.com>
804
805         * typeck.c (build_x_indirect_ref): Add location argument.
806         * class.c (build_base_path): Pass location to build_indirect_ref.
807         * pt.c (tsubst_copy_and_build): Pass location to
808         finish_label_address_expr.
809         * parser.c (cp_parser_unary_expression): Same.
810
811 2008-08-31  Jason Merrill  <jason@redhat.com>
812
813         Implement late-specified return type using 'auto'.
814         * cp-tree.h (struct cp_declarator): Add late_return_type field to
815         function declarator.
816         * parser.c (cp_parser_late_return_type_opt): New fn.
817         (cp_parser_direct_declarator): Use it.
818         (make_call_declarator): Put it in the declarator.
819         * decl.c (grokdeclarator): Splice in late-specified return type.
820         * pt.c (splice_late_return_type): New fn.
821
822 2008-08-29  Michael Meissner  <gnu@the-meissners.org>
823
824         * decl.c (builtin_function_1): Take a bool argument to decide
825         whether to use pushdecl or pushdecl_top_level.
826         (duplicate_decls): Copy function specific target and optimization
827         options on duplicate declarations.
828         (cxx_builtin_function): Update builtin_function_1 call.
829         (cxx_builtin_function_ext_scope): New function, guarantee that the
830         declaration is done at global scope.
831
832         * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
833         macro, define builtin function hook for delayed machine specific
834         builtins.
835
836         * cp-tree.h (cxx_builtin_function_ext_scope): Add declaration.
837
838 2008-08-30  Jason Merrill  <jason@redhat.com>
839
840         PR c++/37288
841         * pt.c (dependent_type_p): Don't abort on auto outside of a template.
842
843 2008-08-29  Jason Merrill  <jason@redhat.com>
844
845         Implement C++0x 'auto' semantics.
846         * decl.c (start_decl_1): Don't complain about auto being incomplete.
847         (cp_finish_decl): Deduce auto.
848         * init.c (build_new): Handle 'new auto'.
849         * typeck2.c (cxx_incomplete_type_diagnostic): Give a different
850         message for auto than for normal template type parms.
851         * pt.c (type_dependent_expression_p): Handle { }.
852         (make_auto): New function.
853         (listify_autos): New function.
854         (do_auto_deduction): New function.
855         (is_auto): New function.
856         (type_uses_auto): New function.
857         * cp-tree.h: Declare them.
858         * parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't
859         treat auto as a declspec.
860         (cp_parser_simple_type_specifier): It's a type-specifier.
861
862 2008-08-29  Mark Mitchell  <mark@codesourcery.com>
863
864         * mangle.c (write_type): Add target-specific manglings for
865         non-fundamental types to the substitution table.
866         gcc/testsuite/
867
868 2008-08-29  Jakub Jelinek  <jakub@redhat.com>
869
870         PR fortran/29635
871         PR fortran/23057
872         * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using):
873         Adjust debug_hooks->imported_module_or_decl callers.
874
875 2008-08-29  Jan Hubicka  <jh@suse.cz>
876
877         * cp-gimplify.c (cp_gimplify_expr): Add PRED_CONTINUE heuristic.
878
879 2008-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
880
881         PR c++/37260
882         * decl.c (reshape_init_r): Check init for error_mark_node.
883
884 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
885
886         PR c++/17880
887         * semantics.c (maybe_convert_cond): Call verify_sequence_points.
888         (finish_return_stmt): Likewise.
889         (finish_switch_condition): Likewise.
890
891 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
892
893         * cp-tree.h: Fix #error directive.
894
895 2008-08-26  Douglas Gregor  <doug.gregor@gmail.com>
896
897         * typeck.c (type_after_usual_arithmetic_conversions): Don't do the
898         usual arithmetic conversions on scoped enumeration types.
899         (common_type): Ditto.
900         (default_conversion): Don't perform integral promotions on scoped
901         enumeration types. 
902         (build_array_ref): Scoped enumeration types can't be used as
903         subscripts.
904         * decl.c (start_enum): If building a C++0x scoped enumeration,
905         enter its scope. If provided with an underlying type, check that
906         underlying type and set up the enumeration type accordingly.
907         (finish_enum): Only compute an underlying type if the underlying
908         type isn't already fixed, and only convert the enumerator values
909         now if we've just computed the underlying type. Finish the scope
910         of C++0x scoped enumerations.
911         (build_enumerator): For enumerations with a fixed underlying type,
912         check the enumerator values when the enumerator is defined.
913         (lookup_enumerator): New.
914         * call.c (standard_conversion): Don't allow assignment from
915         integers to scoped enumeration types, even with -fpermissive.
916         Don't convert from scoped enumerations to bool or any arithmetic
917         types.
918         (build_conditional_expr): Don't per the usual arithmetic
919         conversions for scoped enumeration types.
920         (convert_like_real): Check complain to see if we should
921         produce warnings.
922         * error.c (class_key_or_enum_as_string): Print scoped enums.
923         * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
924         TYPE_LANG_FLAG_5.
925         (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
926         (SCOPED_ENUM_P): New.
927         (UNSCOPED_ENUM_P): New.
928         (SET_SCOPED_ENUM_P): New.
929         (ENUM_UNDERLYING_TYPE): New.
930         * pt.c (lookup_template_class): Update the instantiation of enum
931         types to deal with C++0x scoped enumerations and underlying
932         types.
933         * name-lookup.c (begin_scope): Deal with scoped enumeration
934         scopes.
935         (lookup_qualified_name): Deal with lookup into enumeration types.
936         * name-lookup.h (enum scope_kind): Add sk_scoped_enum.
937         * parser.c (cp_parser_class_or_namespace_name): Rename to...
938         (cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
939         parse a type-name that can be an enumeration type.
940         (cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
941         (cp_parser_elaborated_type_specifier): Parse the
942         optional `struct' or `class' following enum (in C++0x).
943         (cp_parser_enum_specifier): Parse C++0x scoped enumerations and
944         enum-base clauses.
945
946 2008-08-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
947
948         * typeck.c: Update all calls to pedwarn.
949         * decl.c: Likewise.
950         * call.c: Likewise.
951         * error.c: Likewise.
952         * pt.c: Likewise.
953         * name-lookup.c: Likewise.
954         * parser.c: Likewise.
955
956 2008-08-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
957
958         PR c++/35158
959         * parser.c (cp_parser_omp_for_loop): Handle parenthesized
960         initializers.
961
962 2008-08-20  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
963
964         * parser.c: Update all calls to inform.
965         * typeck.c: Likewise.
966         * init.c: Likewise.
967         * class.c: Likewise.
968         * call.c: Likewise.
969         * method.c: Likewise.
970         * friend.c: Likewise.
971         * typeck2.c: Likewise.
972         * pt.c: Likewise.
973         * name-lookup.c: Likewise.
974         * lex.c: Likewise.
975
976 2008-08-19  Jakub Jelinek  <jakub@redhat.com>
977
978         PR debug/37156
979         * error.c (cp_print_error_function): Deal with recursive BLOCK trees.
980
981 2008-08-18  Tomas Bily  <tbily@suse.cz>
982
983         * tree.c (cp_tree_equal): Use CONVERT_EXPR_CODE_P.
984
985 2008-08-18  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
986
987         * typeck.c: Update all callers of permerror.
988         * init.c: Likewise.
989         * class.c: Likewise.
990         * decl.c: Likewise.
991         * call.c: Likewise.
992         * except.c: Likewise.
993         * cvt.c: Likewise.
994         * typeck2.c: Likewise.
995         * pt.c: Likewise.
996         * semantics.c: Likewise.
997         * name-lookup.c: Likewise.
998         * lex.c: Likewise.
999         * decl2.c: Likewise.
1000         * parser.c: Likewise.
1001
1002 2008-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1003
1004         PR c++/34485
1005         * pt.c (check_template_shadow): Change to return a bool.
1006         * name-lookup.c (push_class_level_binding): Early return if
1007         check_template_shadow returns false.
1008         * cp-tree.h (check_template_shadow): Adjust declaration.
1009
1010 2008-08-14  Paolo Carlini  <paolo.carlini@oracle.com>
1011
1012         PR c++/34600
1013         * decl.c (grokdeclarator): In case of extern and initializer, return
1014         error_mark_node after the error.
1015
1016 2008-08-13  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1017
1018         PR 30551
1019         * decl.c (grokfndecl): Call check_main_parameters_type only if
1020         -Wmain.
1021
1022 2008-08-12  Paolo Carlini  <paolo.carlini@oracle.com>
1023
1024         PR c++/37087
1025         * parser.c (cp_parser_class_head): Early return error_mark_node in
1026         case of global qualification of class name or qualified name that
1027         does not name a class.
1028
1029 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1030
1031         PR c++/12242
1032         * cvt.c (ocp_convert): Warn for out-of-range conversions to enum.
1033
1034 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1035
1036         PR 36901
1037         * cp-tree.h (struct diagnostic_context, struct diagnostic_info):
1038         Delete forward declarations. Check that toplev.h has not been
1039         included before this file. Include toplev.h and diagnostic.h.
1040         * error.c (cp_cpp_error): Use DK_PEDWARN.
1041         (cxx_incomplete_type_diagnostic): Update declaration.
1042         (cxx_incomplete_type_error): Use DK_ERROR.
1043         * typeck2.c (cxx_incomplete_type_diagnostic): Take a diagnostic_t
1044         as argument. Use emit_diagnostic.
1045         (cxx_incomplete_type_error): Use DK_ERROR.
1046         (add_exception_specifier): Use diagnostic_t instead of custom
1047         codes.  
1048         * typeck.c (complete_type_or_else): Update call to
1049         cxx_incomplete_type_diagnostic.
1050         * init.c (build_delete): Likewise.  
1051         * call.c (diagnostic_fn_t): Remove unused typedef.
1052         (build_temp): Pass a pointer to diagnostic_t.
1053         (convert_like_real): Use emit_diagnostic.
1054         (joust): Check return value of warning before giving informative
1055         note.  
1056         * friend.c (do_friend): Check return value of warning
1057         before giving informative note.
1058         * parser.c (cp_parser_template_id): Likewise.
1059
1060 2008-08-09  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1061
1062         PR 7651
1063         * class.c (check_bases_and_members): Warn with -Wuninitialized
1064         instead of -Wextra.
1065         
1066 2008-08-08  Volker Reichelt  <v.reichelt@netcologne.de>
1067
1068         PR c++/35985
1069         * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
1070         and make sure it is not a union.
1071
1072 2008-08-07  H.J. Lu  <hongjiu.lu@intel.com>
1073
1074         * semantics.c (finish_decltype_type): Initialize type.
1075
1076 2008-08-07  Douglas Gregor  <doug.gregor@gmail.com>
1077
1078         * semantics.c (finish_decltype_type): Handle calls to function
1079         pointers and references to functions properly.
1080
1081 2008-08-06  Douglas Gregor  <doug.gregor@gmail.com>
1082
1083         PR c++/36460
1084         * parser.c (cp_parser_template_argument): Don't assume that '>>'
1085         following a type-id is an error when in C++0x mode.
1086
1087 2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1088
1089         PR 26785
1090         * decl.c (grokdeclarator): Use explicit location with permerror_at.
1091
1092 2008-08-06  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1093
1094         PR 8715
1095         * typeck.c (cp_build_binary_op): Move code to c-common.c.
1096
1097 2008-08-05  Jason Merrill  <jason@redhat.com>
1098
1099         PR c++/37016
1100         * decl.c (build_ptrmemfunc_type): Don't require structural
1101         comparison of PMF types.
1102         * tree.c (cp_build_qualified_type_real): Don't clear
1103         a valid TYPE_PTRMEMFUNC_TYPE.
1104         * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
1105         templates.
1106
1107 2008-08-04  Jason Merrill  <jason@redhat.com>
1108
1109         PR c++/36963
1110         * typeck2.c (check_narrowing): Allow narrowing conversion
1111         from an explicit floating-point constant.
1112
1113         PR c++/37006
1114         * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
1115         instantiations.
1116
1117 2008-08-04  Simon Baldwin  <simonb@google.com>
1118
1119         PR c++/36999
1120         * parser.c (cp_parser_elaborated_type_specifier): Warn only when
1121         the declaration's id is followed by a semicolon.
1122
1123 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
1124
1125         PR c++/36405
1126         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call
1127         complete_type_or_else even for UNKNOWN_TYPE to get diagnostics.
1128
1129 2008-07-31  Jason Merrill  <jason@redhat.com>
1130
1131         PR c++/36633
1132         * init.c (build_new_1): Don't convert pointer to the data type
1133         until we're actually going to treat it as that type.
1134
1135         PR c++/11309
1136         * tree.c (build_aggr_init_expr): Split out...
1137         (build_cplus_new): ...from here.
1138         (stabilize_init): Don't mess with AGGR_INIT_EXPR either.
1139         * init.c (build_new_1): new T() means value-initialization,
1140         not default-initialization.
1141         (build_vec_init): Likewise.
1142         (build_value_init_1): Use build_aggr_init_expr.
1143
1144 2008-07-30  Dodji Seketeli  <dseketel@redhat.com>
1145
1146         PR c++/36767
1147         * decl2.c (fix_temporary_vars_context_r): New function.
1148          (one_static_initialization_or_destruction): Make sure temporary
1149          variables part of the initialiser have their DECL_CONTEXT()
1150          properly set.
1151
1152 2008-07-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1153
1154         PR 34389
1155         * typeck.c (build_binary_op): Encapsulate code into
1156         shorten_binary_op.
1157
1158 2008-07-29  Jakub Jelinek  <jakub@redhat.com>
1159
1160         PR c++/36852
1161         * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
1162         TYPE_UID instead of pointers.
1163
1164 2008-07-29  Jan Hubicka  <jh@suse.cz>
1165
1166         * optimize.c (maybe_clone_body): Remove DECL_INLINE.
1167         * decl.c (duplicate_decls): Likewise.
1168         (grokfndecl): Likewise.
1169         (start_method): Likewise.
1170         * method.c (make_thunk, make_alias_for, implicitly_declare_fn):
1171         Likewise.
1172         * pt.c (register_specialization, regenerate_decl_from_template):
1173         Likewise.
1174         * decl2.c (grokfield): Likewise.
1175
1176 2008-07-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1177
1178         PR 34985
1179         * decl.c (duplicate_decls): Merge USED flags.
1180
1181 2008-07-27  Jason Merrill  <jason@redhat.com>
1182
1183         PR c++/36943
1184         * decl.c (reshape_init_r): Allow C++0x initializer lists.
1185
1186 2008-07-28  Richard Guenther  <rguenther@suse.de>
1187
1188         Merge from gimple-tuples-branch.
1189
1190         2008-07-22  Aldy Hernandez  <aldyh@redhat.com>
1191
1192         * cp-gimplify.c (gimplify_if_stmt): Set location on newly created
1193         COND_EXPR.
1194
1195         2008-07-18  Jakub Jelinek  <jakub@redhat.com>
1196
1197         * decl.c (finish_function): Call gimple_body after cp_genericize.
1198
1199         2008-07-18  Aldy Hernandez  <aldyh@redhat.com>
1200
1201         * optimize.c: Include gimple.h instead of tree-gimple.h.
1202         * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h.
1203         * cp-gimplify.c: Rename tree-gimple.h to gimple.h.  Include
1204         tree-iterator.h.
1205
1206         2008-07-16  Jakub Jelinek  <jakub@redhat.com>
1207
1208         * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone.
1209
1210         2008-07-14  Jakub Jelinek  <jakub@redhat.com>
1211
1212         * cp-gimplify.c (cp_gimplify_expr): Update comment.
1213
1214         2008-07-14  Aldy Hernandez  <aldyh@redhat.com>
1215
1216         * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to
1217         TREE_CHAIN.
1218         * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename
1219         GIMPLE_MODIFY_STMT to MODIFY_EXPR.
1220         (cxx_omp_clause_copy_ctor): Same.
1221         (cxx_omp_clause_assign_op): Same.
1222
1223         2008-05-28  Jakub Jelinek  <jakub@redhat.com>
1224
1225         * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument.  Tuplify.
1226         (cp_gimplify_expr): Adjust caller.
1227
1228         2008-05-11 Doug Kwan  <dougkwan@google.com>
1229
1230         * init.c (build_vec_delete): Add type conversion for argument
1231         0 of POINTER_PLUS_EXPR.
1232
1233         2008-04-29  Doug Kwan  <dougkwan@google.com>
1234
1235         * decl2 (File): Include "gimple.h"
1236         (cp_write_global_declarations): Use gimple_body instead of
1237         DECL_SAVED_TREE.
1238         * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
1239
1240         2008-04-10  Diego Novillo  <dnovillo@google.com>
1241
1242         http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html
1243
1244         * optimize.c (maybe_clone_body): Re-enable call to
1245         clone_body.
1246         * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled
1247         code with call to gimple_unreachable.
1248         (cp_genericize): Fix handling of clone bodies.
1249
1250         2008-04-04  Diego Novillo  <dnovillo@google.com>
1251
1252         http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html
1253
1254         * optimize.c (maybe_clone_body): Re-enable.
1255
1256         2008-02-19  Diego Novillo  <dnovillo@google.com>
1257                     Oleg Ryjkov  <olegr@google.com>
1258
1259         http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
1260
1261         * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq
1262         argument to gimple_seq *.  Update all users.
1263         (gimplify_must_not_throw_expr): Likewise.
1264
1265         2008-02-04  Oleg Ryjkov <olegr@google.com>
1266
1267         * except.c: Include gimple.h
1268         (cp_protect_cleanup_actions): Convert to tuples.
1269         * Make-lang.in (cp/except.o): Add dependency on gimple.h
1270
1271         2007-11-10  Aldy Hernandez  <aldyh@redhat.com>
1272
1273         * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus
1274         instead of annotating each block manually.
1275
1276         2007-10-30  Aldy Hernandez  <aldyh@redhat.com>
1277
1278         * cp-gimplify.c (gimplify_cp_loop): Tuplify.
1279         (gimplify_for_stmt): Same.
1280         (gimplify_switch_stmt): Same.
1281         (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt.  Return
1282         GS_OK.
1283         [WHILE_STMT]: Return GS_OK.
1284         [SWITCH_STMT]: Same.
1285         [CONTINUE_STMT]: Same.
1286         [BREAK_STMT]: Same.
1287         (cp_genericize): Set gimple_body() of cloned functions when needed.
1288
1289         2007-10-29  Aldy Hernandez  <aldy@quesejoda.com>
1290
1291         * cp-gimplify.c: Move build_gimple_eh_filter_tree here.
1292         (cp_gimplify_init_expr): Convert to tuples.
1293         (gimplify_must_not_throw_expr): Make function return a
1294         gimplify_status and convert to tuples.
1295
1296         2007-10-18  Aldy Hernandez  <aldy@quesejoda.com>
1297
1298         * cp-gimplify.c (genericize_try_block): Enable and do not call
1299         gimplify_stmt.
1300         (genericize_catch_block): Same.
1301         (genericize_eh_spec_block): Same.
1302         Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1303         (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK.
1304
1305         2007-10-16  Aldy Hernandez  <aldy@quesejoda.com>
1306
1307         * optimize.c (maybe_clone_body): Comment out call to clone_body.
1308         * decl.c (finish_function): Use gimple_body instead of
1309         DECL_SAVED_TREE.
1310         * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences.
1311         * cp-gimplify.c (genericize_try_block): Comment out.
1312         (genericize_catch_block): Same.
1313         (genericize_eh_spec_block): Same.
1314         (gimplify_cp_loop): Comment out calls to gimplify_stmt.
1315         (gimplify_for_stmt): Comment out.
1316         (gimplify_switch_stmt): Comment out call to gimplify_stmt.
1317         (cp_gimplify_omp_for): Same.
1318         (gimplify_must_not_throw_expr): Argument pre_p is a sequence.
1319         Comment out call to gimplify_stmt and append_to_statement_list.
1320         Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
1321         (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences.
1322         (cp_gimplify_expr): Same.
1323         Comment out calls to genericize_*_block.  Comment out call to
1324         gimplify_for_stmt.
1325
1326 2008-07-27  H.J. Lu  <hongjiu.lu@intel.com>
1327
1328         PR c++/36944
1329         * class.c (type_has_user_provided_default_constructor): Handle
1330         default parameters.
1331
1332 2008-07-27  Paolo Carlini  <paolo.carlini@oracle.com>
1333
1334         * decl.c (push_library_fn): Add a parameter for the exceptions that
1335         the function may throw.
1336         (push_void_library_fn, push_throw_library_fn, expand_static_init):
1337         Adjust.
1338         (build_library_fn): Change to static.
1339         * cp-tree.h: Adjust declarations.
1340         * except.c (declare_nothrow_library_fn): New.
1341         (do_get_exception_ptr, do_begin_catch, do_free_exception,
1342         do_allocate_exception):  Use the latter, adjust the declarations
1343         (ie, add empty exception-specification), consistently with the
1344         actual implementation in libsupc++.
1345
1346 2008-07-25  Jan Hubicka  <jh@suse.cz>
1347
1348         * typeck.c (inline_conversion): Remove.
1349         (cp_build_function_call): Do not use inline_conversion.
1350         * decl.c (duplicate_decls): Do not insist on inline being declared
1351         early.
1352         (start_cleanup_fn): Do not assume that INLINE flags prevent function
1353         from being output.  We now remove static functions always.
1354         (finish_function): Do return warning on all static functions.
1355         * call.c (build_over_call): Do not use inline_conversion.
1356         * cp-tree.h (possibly_inlined_p): Declare.
1357         (inline_conversion): Remove.
1358         * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
1359         * decl2.c (cp_write_global_declarations): Likewise.
1360         (mark_used): Likewise.
1361         (possibly_inlined_p): New functions.
1362
1363 2008-07-25  Jason Merrill  <jason@redhat.com>
1364
1365         * class.c (type_has_user_provided_default_constructor): Handle
1366         templates.
1367
1368 2008-07-23  Jan Hubicka  <jh@suse.cz>
1369
1370         * decl.c (duplicate_decls): Update comment and unit-at-a-time.
1371         (grogfndecl): Drop flag_inline_trees code.
1372         * pt.c (instantiate_decl): Drop flag_iline_trees code.
1373         * lex.c (cxx_init): Do not set unit-at-a-time.
1374
1375 2008-07-23  Jason Merrill  <jason@redhat.com>
1376
1377         * mangle.c (write_unqualified_name): Avoid infinite recursion when
1378         trying to mangle a decl with no name.
1379
1380         Implement defaulted/deleted functions as per N2346
1381         * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
1382         (DECL_DELETED_FN): New macro.
1383         (DECL_DEFAULTED_FN): New macro.
1384         * class.c (user_provided_p): New fn.
1385         (defaultable_fn_p): New fn.
1386         (type_has_user_provided_constructor): New fn.
1387         (type_has_user_provided_default_constructor): New fn.
1388         (check_methods): A defaulted fn is still trivial.
1389         (check_bases_and_members): Likewise.
1390         * decl.c (grok_special_member_properties): Likewise.
1391         (duplicate_decls): Complain about redeclaring a function as deleted.
1392         (start_decl): initialized==2 means deleted.
1393         (cp_finish_decl): Handle deleted/defaulted semantics.
1394         * decl2.c (grokfield): Likewise.
1395         (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
1396         Complain about using a deleted fn.
1397         * init.c (build_value_init_1): Use type_has_user_provided_constructor.
1398         (perform_member_init): Check for a user-provided default constructor
1399         even if TYPE_NEEDS_CONSTRUCTING.
1400         (build_new_1): Likewise.
1401         * call.c (build_over_call): Don't call mark_used twice.
1402         * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
1403         * search.c (check_final_overrider): Check for deleted mismatch.
1404         * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
1405         (cp_parser_pure_specifier): Handle =default and =delete.
1406
1407         * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
1408
1409 2008-07-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
1410
1411         PR 35058
1412         * typeck.c: All calls to pedwarn changed.
1413         * decl.c: All calls to pedwarn changed.
1414         * call.c: All calls to pedwarn changed.
1415         * error.c: All calls to pedwarn changed.
1416         * typeck2.c: All calls to pedwarn changed.
1417         * pt.c: All calls to pedwarn changed.
1418         * name-lookup.c: All calls to pedwarn changed.
1419         * parser.c: All calls to pedwarn changed.
1420
1421 2008-07-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1422
1423         * call.c: Fix comment typos.
1424         * class.c: Likewise.
1425         * cp-tree.h: Likewise.
1426         * cxx-pretty-print.c: Likewise.
1427         * decl.c: Likewise.
1428         * init.c: Likewise.
1429         * name-lookup.c: Likewise.
1430         * operators.def: Likewise.
1431         * parser.c: Likewise.
1432         * pt.c: Likewise.
1433         * tree.c: Likewise.
1434         * typeck.c: Likewise.
1435
1436 2008-07-21  Paolo Carlini  <paolo.carlini@oracle.com>
1437
1438         PR c++/36871
1439         PR c++/36872
1440         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
1441         copy constructors and copy assignment operators proper.
1442
1443 2008-07-21  Rafael Ávila de Espíndola  <espindola@google.com>
1444
1445         * parser.c (cp_token): Remove in_system_header.
1446         (eof_token): Remove in_system_header.
1447         (cp_lexer_get_preprocessor_token): Don't set in_system_header.
1448         (cp_lexer_set_source_position_from_token): Don't set in_system_header.
1449         (cp_parser_member_declaration):  Use in_system_header_at.
1450         * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
1451         (pop_tinst_level): Don't set in_system_header.
1452         (instantiate_class_template): Don't set in_system_header.
1453         (instantiate_decl): Don't set in_system_header.
1454         (instantiate_pending_templates): Don't set in_system_header.
1455
1456 2008-07-21  Paolo Carlini  <paolo.carlini@oracle.com>
1457
1458         PR c++/36870
1459         * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
1460         TYPE_NOTHROW_P, not TREE_NOTHROW.
1461         (trait_expr_value): Likewise.
1462
1463 2008-07-18  Dodji Seketeli  <dseketel@redhat.com>
1464
1465         PR c++/36407
1466         * call.c (convert_like_real): Don't take the error code path
1467           when a rvalue or base conversion has the bad_p field set.
1468
1469 2008-07-18  Kris Van Hees  <kris.van.hees@oracle.com>
1470
1471         * rtti.c (emit_support_tinfos): Add char16_type_node and
1472         char32_type_node.
1473         * typeck2.c (digest_init): Support char16_t and char32_t.
1474
1475 2008-07-18  Kavih R. Ghazi  <ghazi@caip.rutgers.edu>
1476
1477         * cvt.c (convert_to_void): Avoid C++ keywords.
1478         * decl.c (walk_namespaces_r, wrapup_globals_for_namespace):
1479         Likewise.
1480         * friend.c (is_friend): Likewise.
1481         * init.c (perform_member_init): Likewise.
1482         * mangle.c (write_template_prefix, write_template_template_param):
1483         Likewise.
1484         * name-lookup.c (do_namespace_alias, do_using_directive,
1485         parse_using_directive, ambiguous_decl, arg_assoc): Likewise.
1486         * parser.c (cp_parser_template_id, cp_parser_namespace_definition,
1487         cp_parser_objc_typename, cp_parser_objc_method_keyword_params):
1488         Likewise.
1489         * pt.c (is_specialization_of_friend, lookup_template_class,
1490         push_tinst_level, instantiate_class_template,
1491         tsubst_copy_and_build): Likewise.
1492         * tree.c (add_stmt_to_compound): Likewise.
1493         * typeck.c (finish_class_member_access_expr): Likewise.
1494
1495 2008-07-17  Julian Brown  <julian@codesourcery.com>
1496             Mark Mitchell  <mark@codesourcery.com>
1497
1498         * decl2.c (determine_visibility): Allow target to override
1499         visibility of class data.
1500
1501 2008-07-17  Paolo Carlini  <paolo.carlini@oracle.com>
1502
1503         PR c++/36855
1504         * semantics.c (trait_expr_value): Update __has_trivial_destructor
1505         semantics to the current WP (N2691).
1506
1507 2008-07-16  Dodji Seketeli  <dseketel@redhat.com>
1508
1509         PR c++/13699
1510         * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
1511         (pushdecl_maybe_friend): Check if a redeclaration of extern C function
1512         complies with exception specification constraints.
1513
1514 2008-07-14  Jason Merrill  <jason@redhat.com>
1515
1516         * lex.c (init_reswords): Always set D_OBJC.
1517
1518 2008-07-11  Tom Tromey  <tromey@redhat.com>
1519             Ian Lance Taylor  <iant@google.com>
1520
1521         * lex.c (struct resword, reswords): Don't define.
1522         (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define.
1523         (init_reswords): Clarify mask code.  Use c_common_reswords rather
1524         than reswords.
1525
1526 2008-07-11  Dodji Seketeli  <dseketel@redhat.com>
1527
1528         PR c++/13101
1529         * decl.c (grokdeclarator): Warn about initializing variables
1530         of storage class 'extern' only after the type of the declarator
1531         has been properly computed.
1532
1533 2008-07-11  Dodji Seketeli  <dseketel@redhat.com>
1534
1535         PR c++/31754
1536         * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It
1537         carries the location of the primary type.
1538         * parser.c (cp_parser_check_type_definition): Update documentation.
1539         (cp_parser_check_for_definition_in_return_type,
1540         cp_parser_check_for_invalid_template_id,
1541         cp_parser_set_decl_spec_type,
1542         cp_parser_check_for_definition_in_return_type,
1543         cp_parser_diagnose_invalid_type_name,
1544         cp_parser_new_expression, cp_parser_explicit_instantiation,
1545         cp_parser_type_specifier, cp_parser_simple_type_specifier,
1546         cp_parser_omp_for_loop, cp_parser_pragma): Use location in error
1547         messages.
1548
1549 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
1550
1551         PR c++/31754
1552         * pt.c, semantic.c:
1553         * semantic.c (qualified_name_lookup_error, finish_id_expression):
1554         Add a location_t parameter so that
1555         error message can have a more accurate location.
1556         * cp-tree.h: Updated prototype
1557         * pt.c (tsubst_qualified_id): Use location in error messages.
1558         * parser.c (cp_parser_postfix_expression,
1559         cp_parser_objc_statement, cp_parser_trait_expr,
1560         cp_parser_token_is_class_key,
1561         cp_parser_uncommitted_to_tentative_parse_p,
1562         cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
1563         cp_parser_error, cp_parser_name_lookup_error,
1564         cp_parser_simulate_error, cp_parser_check_decl_spec,
1565         cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
1566         cp_parser_diagnose_invalid_type_name,
1567         cp_parser_parse_and_diagnose_invalid_type_name,
1568         cp_parser_require_pragma_eol, cp_parser_make_typename_type,
1569         cp_parser_string_literal, cp_parser_primary_expression,
1570         cp_parser_primary_expression, cp_parser_unqualified_id,
1571         cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
1572         cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
1573         cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
1574         cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
1575         cp_parser_jump_statement, cp_parser_block_declaration,
1576         cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
1577         cp_parser_function_specifier_opt, cp_parser_decltype,
1578         cp_parser_mem_initializer_list, cp_parser_mem_initializer,
1579         cp_parser_mem_initializer_id, cp_parser_template_parameter,
1580         cp_parser_type_parameter, cp_parser_template_id,
1581         cp_parser_template_name, cp_parser_template_argument): Likewise.
1582
1583 2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
1584
1585         PR c++/36760
1586         * pt.c (tsubst_function_type): Remove warning for type qualifiers
1587         on function return type.
1588
1589 2008-07-09  Paolo Carlini  <paolo.carlini@oracle.com>
1590
1591         PR c++/36760
1592         * pt.c (tsubst_function_type): Don't warn for type qualifiers
1593         on function return type in case of system header.
1594
1595 2008-07-09  Raksit Ashok <raksit@google.com>
1596
1597         * parser.c (cp_parser_postfix_expression): New warning based on flag
1598         warn_disallowed_functions.
1599
1600 2008-07-08  Simon Martin  <simartin@users.sourceforge.net>
1601
1602         PR c++/34963
1603         * decl.c (grokdeclarator): Reset storage_class and staticp for friend
1604         functions declared with a storage class qualifier.
1605
1606 2008-07-03  Richard Guenther  <rguenther@suse.de>
1607
1608         PR c++/36128
1609         * typeck.c (cp_build_function_call): Move code to verify
1610         builtin function arguments ...
1611         * call.c (build_cxx_call): ... here.
1612
1613 2008-07-02  Jason Merrill  <jason@redhat.com>
1614
1615         * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
1616
1617         Implement WG21 N2672, Initializer List proposed wording
1618         * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
1619         (struct lang_type_class): Add has_list_ctor bitfield.
1620         (TYPE_HAS_LIST_CTOR): New macro.
1621         (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
1622         (CONSTRUCTOR_IS_DIRECT_INIT): New macro.
1623         (LOOKUP_NO_NARROWING): New macro.
1624         (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
1625         * parser.c (cp_parse_braced_list): Split out from...
1626         (cp_parser_initializer_clause): ...here.
1627         (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
1628         literal here.
1629         (cp_lexer_next_token_is_not_keyword): New fn.
1630         (cp_parser_parenthesized_expression_list): Handle { }.
1631         (cp_parser_new_expression, cp_parser_new_initializer): Likewise.
1632         (cp_parser_assignment_expression, cp_parser_condition): Likewise.
1633         (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
1634         (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
1635         (cp_parser_initializer, cp_parser_functional_cast): Likewise.
1636         (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
1637         (cp_parser_save_member_function_body): Likewise.
1638         * call.c (conversion_kind): Add ck_list, ck_aggr.
1639         (struct conversion): Add check_narrowing bitfield, conversion list.
1640         (build_list_conv): New fn.
1641         (build_aggr_conv): New fn.
1642         (implicit_conversion): Call them.
1643         (standard_conversion): Set check_narrowing if appropriate.
1644         (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
1645         (build_user_type_conversion_1): When converting from an init list,
1646         we allow additional conversions except when calling a copy ctor.
1647         (convert_like_real): Calling an explicit ctor for an init list is
1648         ill-formed.  Handle ck_list and ck_addr.  Check narrowing.
1649         (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
1650         class doesn't have a list ctor, break the {} into a TREE_LIST.
1651         (compare_ics): ck_list is better than other UDCs.
1652         (set_up_extended_ref_temp): Split out from initialize_reference.
1653         (is_std_init_list): New fn.
1654         (is_list_ctor): New fn.
1655         * decl.c (cxx_init_decl_processing): Create init_list_type_node.
1656         (reshape_init_array_1): Pass it to build_constructor.
1657         (reshape_init_class): Ditto.
1658         (initialize_artificial_var): Pass the appropriate type.
1659         (build_aggr_init_full_exprs): Split out from...
1660         (check_initializer): ...here.  Handle new semantics.
1661         (build_init_list_var_init): New subroutine of check_initializer.
1662         (grokdeclarator): Converting constructors can have more than one parm.
1663         (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
1664         * init.c (expand_default_init): Only do digest_init for aggregates.
1665         * rtti.c (tinfo_base_init): Pass init_list_type_node to
1666         build_constructor_from_list.
1667         (generic_initializer, ptr_initializer): Ditto.
1668         (ptm_initializer, class_initializer): Ditto.
1669         (get_pseudo_ti_init): Ditto.
1670         * error.c (dump_type): Handle init_list_type_node.
1671         (maybe_warn_cpp0x): New fn.
1672         (maybe_varn_variadic_templates): Call it.
1673         * cvt.c (ocp_convert): Handle conversion from { }.
1674         * tree.c (build_array_of_n_type): New fn.
1675         * typeck2.c (store_init_value): Use init_list_type_node.
1676         (digest_init): Likewise.
1677         (check_narrowing): New fn.
1678         * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
1679         of vector of constructor elts.  Handle non-aggregate types.  Make
1680         constant literals static.
1681         * pt.c: (tsubst_copy_and_build): Adjust.
1682         (unify): Handle { }.
1683         * name-lookup.c (arg_assoc_type): Handle init_list_type_node.
1684
1685 2008-07-01  Daniel Jacobowitz  <dan@codesourcery.com>
1686
1687         * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
1688         (comp_ptr_ttypes_const): Likewise.
1689
1690 2008-07-01  Andrew Haley  <aph@redhat.com>
1691
1692         * decl.c (finish_constructor_body): Don't set the return value of
1693         the constructor if the constructor is that of a Java type.
1694
1695 2008-06-30  Jakub Jelinek  <jakub@redhat.com>
1696
1697         PR c++/36662
1698         * decl2.c (is_late_template_attribute): If the first attribute
1699         argument is IDENTIFIER_NODE, don't consider it when checking
1700         if arguments are value or type dependent.
1701
1702 2008-06-29  Paolo Carlini  <paolo.carlini@oracle.com>
1703
1704         PR c++/36655
1705         * pt.c (do_type_instantiation): In c++0x mode do not warn for
1706         extern template.
1707
1708 2008-06-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1709
1710         * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
1711
1712 2008-06-28  Jakub Jelinek  <jakub@redhat.com>
1713
1714         PR c++/36364
1715         * repo.c (repo_emit_p): Put const static data members initialized
1716         by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN
1717         for it is 0.
1718
1719 2008-06-27  Paolo Carlini  <paolo.carlini@oracle.com>
1720
1721         PR c++/36655
1722         * pt.c (do_decl_instantiation): In c++0x mode do not warn for
1723         extern template.
1724
1725 2008-06-24  Jonathan Wakely  <jwakely.gcc@gmail.com>
1726
1727         PR c++/23194
1728         * typeck.c (cp_build_function_call): Show example syntax in
1729         diagnostic.
1730
1731 2008-06-21  Jonathan Wakely  <jwakely.gcc@gmail.com>
1732
1733         * typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
1734         cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
1735         pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
1736         build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
1737         pedwarn to permerror.
1738         * init.c (perform_member_init, build_new_1, build_new): Likewise.
1739         * decl.c (warn_extern_redeclared_static, duplicate_decls,
1740         * identify_goto, check_previous_goto_1, check_goto, define_label,
1741         check_tag_decl, start_decl, check_class_member_definition_namespace,
1742         grokfndecl, grokdeclarator): Likewise.
1743         * except.c (check_handlers): Likewise.
1744         * typeck2.c (digest_init): Likewise.
1745         * pt.c (check_specialization_namespace,
1746         check_explicit_instantiation_namespace,
1747         maybe_process_partial_specialization, check_explicit_specialization,
1748         convert_template_argument, do_decl_instantiation,
1749         do_type_instantiation, instantiate_decl): Likewise.
1750         * semantics.c (finish_template_type_parm): Likewise.
1751         * name-lookup.c (pushdecl_maybe_friend,
1752         check_for_out_of_scope_variable): Likewise.
1753         * decl2.c (finish_static_data_member_decl, build_anon_union_vars,
1754         coerce_new_type): Likewise.
1755         * parser.c (cp_parser_nested_name_specifier_opt,
1756         cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
1757         cp_parser_class_head, cp_parser_check_class_key): Likewise.
1758         (cp_parser_parameter_declaration): Check flag_permissive instead of
1759         flag_pedantic_errors.
1760         * call.c (joust): Change pedwarn to warning.
1761         * friend.c (make_friend_class): Likewise.
1762
1763 2008-06-16  Jan Hubicka  <jh@suse.cz>
1764
1765         * method.c: Include cgraph.h.
1766         (use_thunk): Use cgraph_add_new_function instead of calling backend
1767         directly.
1768
1769 2008-06-15  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1770
1771         * parser.c: Fix comment typo.
1772
1773 2008-06-14  Simon Martin  <simartin@users.sourceforge.net>
1774
1775         PR c++/35320
1776         * decl2.c (grokbitfield): Receive the list of attributes, pass it to
1777         grokdeclarator and apply it to the created declaration.
1778         * cp-tree.h (grokbitfield): Update prototype.
1779         * parser.c (cp_parser_member_declaration): Don't apply the attributes
1780         since they are now applied in grokbitfield. Adjusted the call to
1781         grokbitfield.
1782         (cp_parser_objc_class_ivars): Likewise.
1783
1784 2008-06-14  Simon Martin  <simartin@users.sourceforge.net>
1785
1786         PR c++/35317
1787         * class.c (type_requires_array_cookie): Do not consider delete[]
1788         operators with an ellipsis as second argument.
1789
1790 2008-06-09  Jakub Jelinek  <jakub@redhat.com>
1791
1792         PR c++/36408
1793         * semantics.c (stmt_expr_value_expr): Don't crash on empty
1794         STATEMENT_LIST.
1795
1796 2008-06-08  Paolo Carlini  <paolo.carlini@oracle.com>
1797
1798          PR c++/35242
1799          * pt.c (maybe_process_partial_specialization): Check the tree
1800         returned by push_template_decl for error_mark_node.
1801         * parser.c (cp_parser_class_head): Likewise, check the tree
1802         returned by the latter.
1803
1804 2008-06-07  Paolo Carlini  <paolo.carlini@oracle.com>
1805
1806          PR c++/35327
1807          * decl.c (grokdeclarator): In case of wrong return type return
1808         immediately error_mark_node.
1809
1810 2008-06-06  Jakub Jelinek  <jakub@redhat.com>
1811
1812         * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
1813         dependent_omp_for_p, begin_omp_task, finish_omp_task,
1814         finish_omp_taskwait): New prototypes.
1815         (cxx_omp_clause_default_ctor): Add outer argument.
1816         (finish_omp_for): Add new clauses argument.
1817         * cp-gimplify.c (cxx_omp_finish_clause): New function.
1818         (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
1819         (cxx_omp_clause_default_ctor): Add outer argument.
1820         (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
1821         * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
1822         * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
1823         Add par_clauses argument.  If decl is present in parallel's
1824         lastprivate clause, change that clause to shared and add
1825         a lastprivate clause for decl to OMP_FOR_CLAUSES.
1826         Fix wording of error messages.  Adjust finish_omp_for caller.
1827         Add clauses argument.  Parse loops with random access iterators.
1828         (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
1829         functions.
1830         (cp_parser_omp_for, cp_parser_omp_parallel): Adjust
1831         cp_parser_omp_for_loop callers.
1832         (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
1833         functions.
1834         (cp_parser_omp_clause_name): Handle collapse and untied
1835         clauses.
1836         (cp_parser_omp_clause_schedule): Handle auto schedule.
1837         (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
1838         and PRAGMA_OMP_CLAUSE_UNTIED.
1839         (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
1840         (OMP_TASK_CLAUSE_MASK): Define.
1841         (cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
1842         (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
1843         (cp_parser_pragma): Handle PRAGMA_OMP_TASK and
1844         PRAGMA_OMP_TASKWAIT.
1845         * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
1846         OMP_CLAUSE_UNTIED.  Handle OMP_CLAUSE_LASTPRIVATE_STMT.
1847         (tsubst_omp_for_iterator): New function.
1848         (dependent_omp_for_p): New function.
1849         (tsubst_expr) <case OMP_FOR>: Use it.  Handle collapsed OMP_FOR
1850         loops.  Adjust finish_omp_for caller.  Handle loops with random
1851         access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR} changes.
1852         (tsubst_expr): Handle OMP_TASK.
1853         * semantics.c (cxx_omp_create_clause_info): New function.
1854         (finish_omp_clauses): Call it.  Handle OMP_CLAUSE_UNTIED and
1855         OMP_CLAUSE_COLLAPSE.
1856         (cxx_omp_predetermined_sharing): Removed.
1857         * semantics.c (finish_omp_for): Allow pointer iterators.  Use
1858         handle_omp_for_class_iterator and dependent_omp_for_p.  Handle
1859         collapsed for loops.  Adjust c_finish_omp_for caller.  Add new
1860         clauses argument.  Fix check for type dependent cond or incr.
1861         Set OMP_FOR_CLAUSES to clauses.  Use cp_convert instead of
1862         fold_convert to convert incr amount to difference_type.  Only
1863         fold if not in template.  If decl is mentioned in lastprivate
1864         clause, set OMP_CLAUSE_LASTPRIVATE_STMT.  Handle loops with random
1865         access iterators.  Adjust for OMP_FOR_{INIT,COND,INCR}
1866         changes.
1867         (finish_omp_threadprivate): Allow static class members of the
1868         current class.
1869         (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
1870         finish_omp_taskwait): New functions.
1871
1872         * parser.c (cp_parser_binary_expression): Add prec argument.
1873         (cp_parser_assignment_expression): Adjust caller.
1874         * cp-tree.h (outer_curly_brace_block): New prototype.
1875         * decl.c (outer_curly_brace_block): No longer static.
1876
1877 2008-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
1878
1879          PR c++/36404
1880          * pt.c (push_template_decl_real): Consistently return error_mark_node
1881         on error.
1882
1883 2008-06-02  Tomas Bily  <tbily@suse.cz>
1884
1885          * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
1886          (cp_build_unary_op): Likewise.
1887          (cp_build_indirect_ref): Use CONVERT_EXPR_P.
1888          (maybe_warn_about_returning_address_of_local): Likewise.
1889
1890 2008-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
1891
1892          PR c++/35243
1893          * pt.c (tsubst_initializer_list): Consistently check the tree
1894          returned by tsubst_pack_expansion for error_mark_node.
1895
1896 2008-05-27  Michael Matz  <matz@suse.de>
1897
1898         PR c++/27975
1899         * call.c (build_new_op): Make warning conditional on
1900         OPT_Wenum_compare.
1901
1902 2008-05-27  Alexandre Oliva  <aoliva@redhat.com>
1903
1904         PR c++/35909
1905         * call.c (convert_like_real): Convert bitfield to desired type
1906         before creating temporary.
1907
1908 2008-05-26  Daniel Franke  <franke.daniel@gmail.com>
1909
1910         * Makefile.in: Adjusted dependencies on c-incpath.o.
1911
1912 2008-05-23  Jakub Jelinek  <jakub@redhat.com>
1913
1914         PR c++/36237
1915         * cp-gimplify.c (cxx_omp_clause_apply_fn): Call
1916         fold_build_cleanup_point_expr on build_call_a results.
1917
1918         PR c++/36308
1919         * semantics.c (omp_clause_info_fndecl): New function.
1920         (finish_omp_clauses): Use it.
1921
1922 2008-05-21  Jakub Jelinek  <jakub@redhat.com>
1923
1924         PR c++/36023
1925         * cp-tree.h (check_array_initializer): New prototype.
1926         * decl.c (check_array_initializer): New function.
1927         (check_initializer): Call it.
1928         * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs.
1929
1930 2008-05-21  Tom Tromey  <tromey@redhat.com>
1931
1932         * mangle.c (save_partially_mangled_name): Remove.
1933         (restore_partially_mangled_name): Likewise.
1934         (write_encoding): Update.
1935         (write_unqualified_name): Likewise.
1936         (start_mangling): Always use name_obstack.  Remove 'ident_p'
1937         argument.
1938         (get_identifier_nocopy): Remove.
1939         (finish_mangling_internal): Rename from finish_mangling.
1940         (finish_mangling): New function.
1941         (finish_mangling_get_identifier): Likewise.
1942         (partially_mangled_name, partially_mangled_name_len): Remove.
1943         (mangle_decl_string): Change return type.  Update.
1944         (mangle_decl, mangle_type_string, mangle_special_for_type,
1945         mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable,
1946         mangle_ref_init_variable): Update.
1947
1948 2008-05-12  Paolo Carlini  <paolo.carlini@oracle.com>
1949
1950          PR c++/35331
1951          * semantics.c (begin_class_definition): Extend checks on the first
1952         argument.
1953
1954 2008-05-12  Tomas Bily  <tbily@suse.cz>
1955
1956          * typeck2.c (digest_init): Use CONVERT_EXPR_P.
1957          * call.c (build_over_call): Likewise.
1958          * error.c (dump_expr): Use CASE_CONVERT.
1959          * class.c (fixed_type_or_null): Likewise.
1960
1961 2008-05-11  Volker Reichelt  <v.reichelt@netcologne.de>
1962
1963         * parser.c (cp_parser_omp_clause_reduction): Add missing "expected"
1964         in error message.
1965         (cp_parser_omp_clause_schedule): Remove superfluous "expected"
1966         in error message.
1967
1968 2008-05-07  Kenneth Zadeck  <zadeck@naturalbridge.com>
1969
1970         * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
1971         DECL_LOOPING_CONST_OR_PURE_P attributes.
1972         * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
1973         DECL_PURE_P.
1974
1975 2008-05-02  Simon Baldwin  <simonb@google.com>
1976
1977         PR bootstrap/36108
1978         * typeck.c (build_array_ref): Remove warn_array_subscript_range.
1979
1980 2008-05-01  Simon Baldwin  <simonb@google.com>
1981
1982         * typeck.c (build_array_ref): Call warn_array_subscript_range.
1983
1984 2008-04-30  Jakub Jelinek  <jakub@redhat.com>
1985
1986         PR c++/35986
1987         * pt.c (more_specialized_fn): Stop the loop even if there are no
1988         arguments before ellipsis.
1989
1990 2008-04-29  Jakub Jelinek  <jakub@redhat.com>
1991
1992         PR c++/35650
1993         * parser.c (cp_parser_lookup_name): Look through single function
1994         OVERLOAD.
1995
1996         PR c++/35987
1997         * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
1998         COMPOUND_EXPR if the second argument would be error_mark_node.
1999
2000 2008-04-28  Jason Merrill  <jason@redhat.com>
2001             Liu Guanwei <liu_gw@163.com>
2002
2003         PR c++/57
2004         * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
2005         in default arguments.
2006
2007 2008-04-25  Jan Hubicka  <jh@suse.cz>
2008
2009         * typeck.c (check_return_expr): Update.
2010         * decl.c (start_preparsed_function): Update.
2011         * method.c (use_thunk): Update.
2012
2013 2008-04-24  Jakub Jelinek  <jakub@redhat.com>
2014
2015         PR c++/35758
2016         * cp-tree.h (cp_reconstruct_complex_type): New prototype.
2017         * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
2018         * decl2.c (is_late_template_attribute): Only make vector_size
2019         late tmpl attribute if argument is type or value dependent.
2020         (cp_reconstruct_complex_type): New function.
2021
2022 2008-04-24  Richard Guenther  <rguenther@suse.de>
2023
2024         * typeck.c (cp_build_function_call): Call
2025         check_builtin_function_arguments.
2026
2027 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
2028
2029         * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
2030         (build_ptrmemfunc1): Don't set TREE_INVARIANT.
2031         * init.c (build_zero_init): Don't set TREE_INVARIANT.
2032         * class.c (build_base_path): Don't set TREE_INVARIANT.
2033         (build_vtbl_ref_1): Don't set TREE_INVARIANT.
2034         (build_vtbl_initializer): Don't set TREE_INVARIANT.
2035         * decl.c (build_enumerator): Don't set TREE_INVARIANT.
2036         * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
2037         (generic_initializer): Don't set TREE_INVARIANT.
2038         (ptr_initializer): Don't set TREE_INVARIANT.
2039         (ptm_initializer): Don't set TREE_INVARIANT.
2040         (class_initializer): Don't set TREE_INVARIANT.
2041         * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
2042         * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
2043         (build_template_parm_index): Don't set TREE_INVARIANT.
2044         (reduce_template_parm_level): Don't set TREE_INVARIANT.
2045         (process_template_parm): Don't set TREE_INVARIANT.
2046
2047 2008-04-22  Jason Merrill  <jason@redhat.com>
2048
2049         PR c++/35316
2050         * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
2051         to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
2052         * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
2053
2054 2008-04-22  Jakub Jelinek  <jakub@redhat.com>
2055
2056         PR c++/35747
2057         * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
2058         expression is errorneous.
2059
2060 2008-04-21  Jason Merrill  <jason@redhat.com>
2061
2062         PR c++/35325
2063         * tree.c (cp_tree_equal): Handle FIXED_CST.
2064
2065         PR c++/35678
2066         * pt.c (template_template_parm_bindings_ok_p): Set
2067         processing_template_decl while in this function.
2068
2069 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
2070
2071         * cvt.c (type_promotes_to): Support char16_t and char32_t.
2072         * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
2073         char16_t and char32_t.
2074         * lex.c (reswords): Add char16_t and char32_t (for c++0x).
2075         * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
2076         extended builtin type "u8char{16,32}_t".
2077         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
2078         RID_CHAR{16,32}.
2079         (cp_lexer_print_token): Support CPP_STRING{16,32}.
2080         (cp_parser_is_string_literal): Idem.
2081         (cp_parser_string_literal): Idem.
2082         (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
2083         CPP_STRING{16,32}.
2084         (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
2085         * tree.c (char_type_p): Support char16_t and char32_t as char types.
2086         * typeck.c (string_conv_p): Support char16_t and char32_t.
2087
2088 2008-04-17  Jason Merrill  <jason@redhat.com>
2089
2090         PR c++/35773
2091         * call.c (build_user_type_conversion_1): Represent second step of
2092         copy-init with an rvalue conversion.
2093         (convert_like_real) [ck_user]: Don't implicitly add it here.
2094
2095 2008-04-15  Jakub Jelinek  <jakub@redhat.com>
2096
2097         PR c/35751
2098         * decl.c (layout_var_decl): If extern or static var has variable
2099         size, set TREE_TYPE (decl) to error_mark_node.
2100
2101 2008-04-16  Danny Smith  <dannysmith@users.sourceforge.net>
2102
2103         PR target/35921
2104         * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
2105         to clone.
2106
2107 2008-04-09  Jason Merrill  <jason@redhat.com>
2108
2109         PR c++/35708
2110         * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
2111         not a pushed variable.
2112
2113 2008-04-09  Volker Reichelt  <v.reichelt@netcologne.de>
2114
2115         * call.c (build_op_delete_call): Fix quotation in warning message.
2116         * decl.c (grokdeclarator): Quote keyword in error message.
2117         * pt.c (check_for_bare_parameter_packs): Fix quotation in error
2118         message.
2119
2120         * parser.c (cp_parser_check_type_definition): Print error string
2121         directly rather than using "%s".
2122         (cp_parser_postfix_expression): Fix quotation.
2123         (cp_parser_decltype): Likewise.
2124         (cp_parser_sizeof_operand): Fix quotation. Simplify.
2125
2126         * parser.c (cp_parser_non_integral_constant_expression): Build error
2127         message with CONCAT rather than using "%s".
2128         (cp_parser_primary_expression): Fix quotation.
2129         (cp_parser_postfix_expression): Likewise.
2130         (cp_parser_postfix_dot_deref_expression): Likewise.
2131         (cp_parser_unary_expression): Likewise.
2132         (cp_parser_new_expression): Likewise.
2133         (cp_parser_delete_expression): Likewise.
2134
2135         * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
2136         as `)', not as `('.  Fix quotation.
2137         (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
2138         (cp_parser_primary_expression): Likewise.
2139         (cp_parser_nested_name_specifier_opt): Likewise.
2140         (cp_parser_postfix_expression): Likewise.
2141         (cp_parser_postfix_open_square_expression): Likewise.
2142         (cp_parser_parenthesized_expression_list): Likewise.
2143         (cp_parser_pseudo_destructor_name): Likewise.
2144         (cp_parser_new_expression): Likewise.
2145         (cp_parser_direct_new_declarator): Likewise.
2146         (cp_parser_delete_expression): Likewise.
2147         (cp_parser_cast_expression): Likewise.
2148         (cp_parser_question_colon_clause): Likewise.
2149         (cp_parser_builtin_offsetof): Likewise.
2150         (cp_parser_trait_expr): Likewise.
2151         (cp_parser_label_for_labeled_statement): Likewise.
2152         (cp_parser_compound_statement): Likewise.
2153         (cp_parser_selection_statement): Likewise.
2154         (cp_parser_condition): Likewise.
2155         (cp_parser_iteration_statement): Likewise.
2156         (cp_parser_already_scoped_statement): Likewise.
2157         (cp_parser_simple_declaration): Likewise.
2158         (cp_parser_linkage_specification): Likewise.
2159         (cp_parser_static_assert): Likewise.
2160         (cp_parser_decltype): Likewise.
2161         (cp_parser_conversion_function_id): Likewise.
2162         (cp_parser_operator_function_id): Likewise.
2163         (cp_parser_operator): Likewise.
2164         (cp_parser_type_parameter): Likewise.
2165         (cp_parser_template_id): Likewise.
2166         (cp_parser_explicit_instantiation): Likewise.
2167         (cp_parser_explicit_specialization): Likewise.
2168         (cp_parser_enum_specifier): Likewise.
2169         (cp_parser_namespace_definition): Likewise.
2170         (cp_parser_namespace_alias_definition): Likewise.
2171         (cp_parser_using_declaration): Likewise.
2172         (cp_parser_using_directive): Likewise.
2173         (cp_parser_asm_definition): Likewise.
2174         (cp_parser_direct_declarator): Likewise.
2175         (cp_parser_ptr_operator): Likewise.
2176         (cp_parser_parameter_declaration_clause): Likewise.
2177         (cp_parser_initializer_clause): Likewise.
2178         (cp_parser_class_specifier): Likewise.
2179         (cp_parser_member_specification_opt): Likewise.
2180         (cp_parser_member_declaration): Likewise.
2181         (cp_parser_pure_specifier): Likewise.
2182         (cp_parser_constant_initializer): Likewise.
2183         (cp_parser_base_clause): Likewise.
2184         (cp_parser_exception_specification_opt): Likewise.
2185         (cp_parser_try_block): Likewise.
2186         (cp_parser_function_try_block): Likewise.
2187         (cp_parser_handler): Likewise.
2188         (cp_parser_throw_expression): Likewise.
2189         (cp_parser_asm_operand_list): Likewise.
2190         (cp_parser_attributes_opt): Likewise.
2191         (cp_parser_label_declaration): Likewise.
2192         (cp_parser_constructor_declarator_p): Likewise.
2193         (cp_parser_template_declaration_after_export): Likewise.
2194         (cp_parser_single_declaration): Likewise.
2195         (cp_parser_objc_message_expression): Likewise.
2196         (cp_parser_objc_message_args): Likewise.
2197         (cp_parser_objc_encode_expression): Likewise.
2198         (cp_parser_objc_defs_expression): Likewise.
2199         (cp_parser_objc_protocol_expression): Likewise.
2200         (cp_parser_objc_selector_expression): Likewise.
2201         (cp_parser_objc_protocol_refs_opt): Likewise.
2202         (cp_parser_objc_typename): Likewise.
2203         (cp_parser_objc_method_keyword_params): Likewise.
2204         (cp_parser_objc_superclass_or_category): Likewise.
2205         (cp_parser_objc_try_catch_finally_statement): Likewise.
2206         (cp_parser_objc_synchronized_statement): Likewise.
2207         (cp_parser_objc_throw_statement): Likewise.
2208         (cp_parser_omp_var_list_no_open): Likewise.
2209         (cp_parser_omp_clause_default): Likewise.
2210         (cp_parser_omp_clause_if): Likewise.
2211         (cp_parser_omp_clause_num_threads): Likewise.
2212         (cp_parser_omp_clause_reduction): Likewise.
2213         (cp_parser_omp_clause_schedule): Likewise.
2214         (cp_parser_omp_critical): Likewise.
2215         (cp_parser_omp_for_loop): Likewise.
2216         (cp_parser_omp_sections_scope): Likewise.
2217
2218         * parser.c (cp_parser_template_parameter_list): Simplify.
2219
2220 2008-04-07  James E. Wilson  <wilson@tuliptree.org>
2221
2222         * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
2223
2224 2008-04-07  Jason Merrill  <jason@redhat.com>
2225
2226         PR c++/35734
2227         * class.c (type_has_user_nondefault_constructor): A template
2228         counts as a nondefault constructor.
2229
2230 2008-04-04  Paolo Bonzini  <bonzini@gnu.org>
2231
2232         * decl.c (cxx_push_function_context): Delete.
2233         (cxx_pop_function_context): Delete.
2234         (start_preparsed_function): Merge cxx_push_function_context (!f->decl
2235         code only).
2236         * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
2237         LANG_HOOKS_FUNCTION_FINAL): Delete.
2238         (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
2239         LANG_HOOKS_MISSING_NORETURN_OK_P.
2240         * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
2241         Delete prototype.
2242         * semantics.c (current_stmt_tree): Fix comment.
2243
2244 2008-04-03  Jakub Jelinek  <jakub@redhat.com>
2245
2246         PR c++/35741
2247         * semantics.c (finish_offsetof): Undo effect of convert_from_reference
2248         before calling fold_offsetof.
2249
2250 2008-04-03  Tom Tromey  <tromey@redhat.com>
2251
2252         * Make-lang.in (c++_OBJS): New variable.
2253
2254 2008-04-03  Paolo Bonzini  <bonzini@gnu.org>
2255
2256         * optimize.c (clone_body): New, from tree-inline.c.
2257
2258 2008-04-03  Paolo Bonzini  <bonzini@gnu.org>
2259
2260          * method.c (synthesize_method): Use {push,pop}_function_context.
2261          * name-lookup.c (push_to_top_level): Likewise.
2262          * parser.c (cp_parser_late_parsing_for_member): Likewise.
2263
2264 2008-03-30  Volker Reichelt  <v.reichelt@netcologne.de>
2265
2266         PR c++/35578
2267         * parser.c (cp_parser_decl_specifier_seq): Add location to error
2268         message.
2269
2270 2008-03-27  Tom Tromey  <tromey@redhat.com>
2271
2272         * Make-lang.in: Revert automatic dependency patch.
2273
2274 2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>
2275
2276         PR obj-c++/35704
2277         * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
2278         (build_compound_expr): New, for compatibility with C
2279         build_compound_expr.
2280         (cp_build_compound_expr): Renamed from build_compound_expr.
2281         (build_c_cast): New, for compatibility with C build_c_cast.
2282         (cp_build_c_cast): Renamed from build_c_cast.
2283         * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
2284         * decl.c (cxx_maybe_build_cleanup): Ditto.
2285         * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
2286         (cp_build_compound_expr): Renamed from build_compound_expr.
2287         (build_c_cast): Add C-compatible prototype.
2288         (cp_build_c_cast): Renamed from build_c_cast.
2289         * typeck2.c (build_functional_cast): Use cp_build_c_cast.
2290         * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
2291
2292 2008-03-27  Douglas Gregor  <doug.gregor@gmail.com>
2293
2294         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
2295         tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
2296         ending in a pack expansion, both of which can occur when
2297         substituting into a nested template.
2298         (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
2299         instantiating the sizeof...(X) form, make tsubst_copy do the work.
2300         * parser.c (cp_parser_template_parameter): Deal with unnamed
2301         non-type template parameter packs identified by pack expansions in
2302         the parameter type.
2303
2304 2008-03-26  Jakub Jelinek  <jakub@redhat.com>
2305
2306         PR c++/35546
2307         * pt.c (apply_late_template_attributes): Don't call tsubst on
2308         first attribute argument if it is IDENTIFIER_NODE.
2309
2310         PR c++/35332
2311         * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
2312         and LTGT_EXPR to pp_expression.
2313
2314 2008-03-26  Douglas Gregor  <doug.gregor@gmail.com>
2315
2316         * pt.c (coerce_template_template_parm): Moved the body of the loop
2317         of coerce_template_template_parms here, to make iteration over a
2318         template argument pack simpler.
2319         Also, allow matching of a template parameter pack in the template
2320         template parameter to a template parameter in the template
2321         template argument.
2322         (coerce_template_template_parms): Deal with variadic template
2323         template parameters. Use coerce_template_template_parm.
2324         (unify): Make sure we coerce the template template argument's
2325         template arguments to the template template parameter's template
2326         parameters, not the other way around.
2327
2328 2008-03-25  Tom Tromey  <tromey@redhat.com>
2329
2330         * Make-lang.in: Remove .o targets.
2331         (cp/g++spec.o): Moved to cp/.  Reduce to variable setting.
2332         (GXX_OBJS): Update.
2333         (c++_OBJS): New variable.
2334         (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
2335
2336 2008-03-25  Douglas Gregor  <doug.gregor@gmail.com>
2337
2338         * typeck.c (composite_pointer_type_r): Add SFINAE support.
2339         (composite_pointer_type): Ditto.
2340         (common_type): Fix call to composite_pointer_type.
2341         (cxx_sizeof_nowarn): New; used to be a macro.
2342         (cxx_sizeof_expr): Add SFINAE support.
2343         (cxx_alignof_expr): Ditto.
2344         (decay_conversion): Fix calls for SFINAE support.
2345         (rationalize_conditional_expr): Add SFINAE support.
2346         (build_class_member_access_expr): Ditto.
2347         (finish_class_member_access_expr): Ditto.
2348         (build_x_indirect_ref): Ditto.
2349         (build_indirect_ref): Original version renamed to
2350         cp_build_indirect_ref; new version provides a bridge from
2351         c-common.
2352         (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
2353         support.
2354         (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
2355         (build_function_call): Original version renamed to
2356         cp_build_function_call; new version provides a bridge from
2357         c-common.
2358         (cp_build_function_call): Was build_function_call; added SFINAE
2359         support.
2360         (convert_arguments): Add SFINAE support.
2361         (build_x_binary_op): Ditto.
2362         (build_binary_op): Original version renamed to cp_build_binary_op;
2363         new version provides a bridge from c-common.
2364         (cp_build_binary_op): Was build_binary_op; added SFINAE support.
2365         (pointer_diff): Fix calls for SFINAE.
2366         (build_x_unary_op): Add SFINAE support.
2367         (condition_conversion): Fix calls for SFINAE.
2368         (build_unary_op): Original version renamed to cp_build_unary_op;
2369         new version provides a bridge from c-common.
2370         (cp_build_unary_op): Was build_unary_op; added SFINAE support.
2371         (unary_complex_lvalue): Fix calls for SFINAE.
2372         (build_x_conditional_expr): Add SFINAE support.
2373         (build_x_compound_expr_from_list): Fix calls for SFINAE.
2374         (build_x_compound_expr): Add SFINAE support.
2375         (convert_ptrmem): Fix calls for SFINAE.
2376         (build_static_cast_1): Add SFINAE support.
2377         (build_static_cast): Ditto.
2378         (build_reinterpret_cast_1): Ditto.
2379         (build_reinterpret_cast): Ditto.
2380         (build_const_cast_1): Ditto.
2381         (build_const_cast): Ditto.
2382         (build_c_cast): Ditto.
2383         (build_modify_expr): Original version renamed to
2384         cp_build_modify_expr; new version provides a bridge from c-common.
2385         (cp_build_modify_expr): Was build_modify_expr; added SFINAE
2386         support.
2387         (build_x_modify_expr): Add SFINAE support.
2388         (build_ptrmemfunc): Fix calls for SFINAE.
2389         (convert_for_assignment): Add SFINAE support.
2390         (convert_for_initialization): Ditto.
2391         (check_return_expr): Fix calls for SFINAE.
2392         (lvalue_or_else): Add SFINAE support.
2393         * init.c (perform_member_init): Fix calls for SFINAE.
2394         (emit_mem_initializers): Ditto.
2395         (expand_virtual_init): Ditto.
2396         (expand_cleanup_for_base): Ditto.
2397         (build_aggr_init): Add SFINAE support.
2398         (expand_default_init): Ditto.
2399         (expand_aggr_init_1): Fix calls for SFINAE.
2400         (build_offset_ref): Ditto.
2401         (build_new_1): Add SFINAE support.
2402         (build_new): Ditto.
2403         (build_vec_delete_1): Fix calls for SFINAE.
2404         (get_temp_regvar): Ditto.
2405         (build_vec_init): Add SFINAE support.
2406         (build_dtor_call): Fix calls for SFINAE.
2407         (build_delete): Ditto.
2408         (push_base_cleanups): Ditto.
2409         (build_vec_delete_1): Ditto.
2410         * class.c (build_base_path): Fix calls for SFINAE.
2411         (build_simple_base_path): Ditto.
2412         (convert_to_base_statically): Ditto.
2413         (build_vfn_ref): Ditto.
2414         (resolve_address_of_overloaded_function): Ditto.
2415         * decl.c (check_initializer): Fix calls for SFINAE.
2416         (register_dtor_fn): Ditto.
2417         (compute_array_index_type): Ditto.
2418         (finish_enum): Ditto.
2419         (start_preparsed_function): Ditto.
2420         (cxx_maybe_build_cleanup): Ditto.
2421         * call.c (convert_like): Add COMPLAIN argument.
2422         (convert_like_with_context): Ditto.
2423         (build_this): Fix calls for SFINAE.
2424         (build_user_type_conversion): Ditto.
2425         (resolve_args): Ditto.
2426         (build_new_function_call): Add SFINAE support.
2427         (build_operator_new_call): Fix calls for SFINAE.
2428         (build_object_call): Add SFINAE support.
2429         (build_conditional_expr): Ditto.
2430         (build_new_op): Ditto.
2431         (build_op_delete_call): Fix calls for SFINAE.
2432         (build_temp): Ditto.
2433         (convert_like_real): Add SFINAE support.
2434         (build_x_va_arg): Fix calls for SFINAE.
2435         (convert_default_arg): Ditto.
2436         (build_over_call): Add SFINAE support.
2437         (build_java_interface_fn_ref): Fix calls for SFINAE.
2438         (build_special_member_call): Add SFINAE support.
2439         (build_new_method_call): Ditto.
2440         (perform_implicit_conversion): Ditto.
2441         (perform_direct_initialization_if_possible): Ditto.
2442         (initialize_reference): Fix calls for SFINAE.
2443         * method.c (do_build_assign_ref): Fix calls for SFINAE.
2444         * rtti.c (build_headof): Fix calls for SFINAE.
2445         (get_tinfo_decl_dynamic): Ditto.
2446         (get_typeid): Ditto.
2447         (build_dynamic_cast_1): Add SFINAE support.
2448         (build_dynamic_cast): Ditto.
2449         (tinfo_base_init): Fix calls for SFINAE.
2450         * except.c (do_get_exception_ptr): Fix calls for SFINAE.
2451         (do_end_catch): Ditto.
2452         (initialize_handler_parm): Ditto.
2453         (expand_start_catch_block): Ditto.
2454         (do_allocate_exception): Ditto.
2455         (do_free_exception): Ditto.
2456         (build_throw): Ditto.
2457         * cvt.c (build_up_reference): Fix calls for SFINAE.
2458         (convert_to_reference): Ditto.
2459         (ocp_convert): Ditto.
2460         (convert_to_void): Add SFINAE support.
2461         * tree.c (build_dummy_object): Fix calls for SFINAE.
2462         (stabilize_expr): Ditto.
2463         * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
2464         parameter.
2465         (build_new_method_call): Ditto.
2466         (build_special_member_call): Ditto.
2467         (build_new_op): Ditto.
2468         (perform_implicit_conversion): Ditto.
2469         (perform_direct_initialization_if_possible): Ditto.
2470         (convert_to_void): Ditto.
2471         (build_aggr_init): Ditto.
2472         (build_new): Ditto.
2473         (build_vec_init): Ditto.
2474         (build_dynamic_cast): Ditto.
2475         (finish_call_expr): Ditto
2476         (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
2477         (cxx_sizeof_nowarn): Remove macro; add function declaration.
2478         (build_class_member_access_expr): Add tsubst_flags_t parameter.
2479         (finish_class_member_access_expr): Ditto.
2480         (build_x_indirect_ref): Ditto.
2481         (cp_build_indirect_ref): New.
2482         (cp_build_function_call): Add tsubst_flags_t parameter.
2483         (build_x_unary_op): Ditto.
2484         (cp_build_unary_op): New.
2485         (build_x_conditional_expr): Add tsubst_flags_t parameter.
2486         (build_x_compound_expr): Ditto.
2487         (build_compound_expr): Ditto.
2488         (build_static_cast): Ditto.
2489         (build_reinterpret_cast): Ditto.
2490         (build_const_cast): Ditto.
2491         (build_c_cast): Ditto.
2492         (build_x_modify_expr): Ditto.
2493         (cp_build_modify_expr): New.
2494         (convert_for_initialization): Add tsubst_flags_t parameter.
2495         (cp_build_binary_op): Remove macro; add function declaration.
2496         (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
2497         (lvalue_or_else): Ditto.
2498         (build_functional_cast): Ditto.
2499         * typeck2.c (digest_init): Fix calls for SFINAE.
2500         (process_init_constructor_array): Ditto.
2501         (process_init_constructor_record): Ditto.
2502         (build_x_arrow): Ditto.
2503         (build_m_component_ref): Ditto.
2504         (build_functional_cast): Add SFINAE support.
2505         * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
2506         * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
2507         (finish_expr_stmt): Ditto.
2508         (finish_for_expr): Ditto.
2509         (finish_asm_stmt): Ditto.
2510         (finish_non_static_data_member): Ditto.
2511         (finish_qualified_id_expr): Ditto.
2512         (finish_call_expr): Add SFINAE support.
2513         (finish_increment_expr): Fix calls for SFINAE.
2514         (finish_unary_op_expr): Ditto.
2515         (simplify_aggr_init_expr): Ditto.
2516         (finish_omp_clauses): Ditto.
2517         (finish_omp_for): Ditto.
2518         (finish_omp_barrier): Ditto.
2519         (finish_omo_flush): Ditto.
2520         * decl2.c (grok_array_decl): Fix calls or SFINAE.
2521         (build_anon_union_vars): Ditto.
2522         (get_guard_cond): Ditto.
2523         (set_guard): Ditto.
2524         (one_static_initialization_or_destruction): Ditto.
2525         (do_static_initialization_or_destruction): Ditto.
2526         (generate_ctor_or_dtor_function): Ditto.
2527         (build_offset_ref_call_from_tree): Ditto.
2528         * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
2529         (cp_parser_postfix_dot_deref_expression): Ditto.
2530         (cp_parser_unary_expression): Ditto.
2531         (cp_parser_new_expression): Ditto.
2532         (cp_parser_cast_expression): Ditto.
2533         (cp_parser_binary_expression): Ditto.
2534         (cp_parser_question_colon_clause): Ditto.
2535         (cp_parser_assignment_expression): Ditto.
2536         (cp_parser_expression): Ditto.
2537         (cp_parser_builtin_offsetof): Ditto.
2538         (cp_parser_template_argument): Ditto.
2539         (cp_parser_functional_cast): Ditto.
2540
2541 2008-03-24  Tom Tromey  <tromey@redhat.com>
2542
2543         * lex.c (handle_pragma_interface): Don't copy the filename.
2544         (handle_pragma_implementation): Copy filename using xstrdup.
2545
2546 2008-03-21  Paolo Carlini  <pcarlini@suse.de>
2547
2548         * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
2549         (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
2550         (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
2551         (PROMOTES_TO_AGGR_TYPE): Remove.
2552         (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
2553         * typeck.c (unary_complex_lvalue, build_modify_expr,
2554         convert_for_initialization): Adjust.
2555         * init.c (is_aggr_type): Remove.
2556         (is_class_type): Add.
2557         (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
2558         build_delete): Adjust.
2559         * lex.c (make_aggr_type): Remove.
2560         (make_class_type): Add.
2561         (cxx_make_type): Adjust.
2562         * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
2563         Adjust.
2564         * decl.c (build_typename_type, make_typename_type,
2565         make_unbound_class_template, cxx_init_decl_processing,
2566         check_tag_decl, groktypename, start_decl_1, layout_var_decl,
2567         check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
2568         grok_op_properties, xref_tag, check_function_type): Adjust.
2569         * call.c (check_dtor_name, standard_conversion, implicit_conversion,
2570         add_builtin_candidate, add_builtin_candidates,
2571         build_user_type_conversion_1, convert_like_real, build_cxx_call,
2572         is_subseq, compare_ics): Adjust.
2573         * method.c (use_thunk): Adjust.
2574         * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
2575         create_tinfo_types): Adjust.
2576         * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
2577         build_up_reference, convert_to_reference, convert_from_reference,
2578         ocp_convert, build_expr_type_conversion): Adjust.
2579         * tree.c (bind_template_template_parm, error_type): Adjust.
2580         * dump.c (cp_dump_tree): Adjust.
2581         * search.c (lookup_member): Adjust.
2582         * friend.c (make_friend_class, do_friend): Adjust.
2583         * typeck2.c (store_init_value, process_init_constructor_array,
2584         process_init_constructor_record, build_x_arrow, build_m_component_ref,
2585         build_functional_cast): Adjust.
2586         * pt.c (finish_member_template_decl, process_template_parm,
2587         lookup_template_class, tsubst_function_type, tsubst,
2588         tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
2589         Adjust.
2590         * semantics.c (begin_class_definition, finish_base_specifier,
2591         finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
2592         Adjust.
2593         * name-lookup.c (constructor_name_p, push_overloaded_decl,
2594         do_class_using_decl, lookup_qualified_name,
2595         maybe_process_template_type_declaration): Adjust.
2596         * decl2.c (grok_array_decl, check_member_template,
2597         constrain_class_visibility): Adjust.
2598         * parser.c (cp_parser_class_name): Adjust.
2599
2600 2008-03-18  Paolo Bonzini  <bonzini@gnu.org>
2601
2602          * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
2603
2604 2008-03-17  Jason Merrill  <jason@redhat.com>
2605
2606         PR c++/35548
2607         * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
2608         a temp directly to a reference as per DR391.
2609
2610 2008-03-12  Richard Guenther  <rguenther@suse.de>
2611
2612         PR c++/35469
2613         Revert:
2614         2008-02-04  Richard Guenther  <rguenther@suse.de>
2615
2616          PR java/35035
2617          * decl.c (record_builtin_java_type): Make jboolean a
2618          integer type again where its mode doesn't match that of bool.
2619
2620         2008-01-25  Richard Guenther  <rguenther@suse.de>
2621
2622          PR c++/33887
2623          * decl.c (record_builtin_java_type): Make __java_boolean
2624          a variant of bool.
2625          * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2626          after TYPE_MAIN_VARIANT check.
2627
2628 2008-03-10  Jakub Jelinek  <jakub@redhat.com>
2629
2630         PR c++/35328
2631         * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
2632         if errorcount.
2633
2634         PR c++/35337
2635         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
2636         DECL_P in not a variable and appears more than once error messages.
2637
2638 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
2639
2640         Revert:
2641
2642         2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
2643
2644         PR c++/35049
2645         PR c++/35096
2646         * typeck.c (structural_comptypes): Call cp_comptypes.
2647         (comptypes): New; called from the C/C++ common bits to perform
2648         strict checks.
2649         (cp_comptypes): Renamed from comptypes, which is already used,
2650         with a different signature, by the C++ front end.
2651         (build_reinterpret_cast_1): Call cp_comptypes.
2652         (ptr_reasonably_similar): Ditto.
2653         * decl.c (decls_match): Ditto.
2654         * cvt.c (convert_to_reference): Ditto.
2655         * cp-tree.h (same_type_p): Ditto.
2656         (same_or_base_type_p): Ditto.
2657         (comptypes): Rename to cp_comptypes.
2658         * pt.c (canonical_type_parameter): Call cp_comptypes.
2659
2660 2008-03-07  Paolo Bonzini  <bonzini@gnu.org>
2661
2662         * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
2663         test for equivalence between pointer and references.
2664
2665 2008-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2666
2667         PR 24924
2668         * class.c (finish_struct_anon): Use permerror instead of pedwarn.
2669         (check_field_decls): Likewise.
2670         (note_name_declared_in_class): Likewise.
2671         * call.c (build_new_op): Likewise.
2672         (convert_like_real): Likewise.
2673         (build_over_call): Likewise.
2674         * lex.c (unqualified_fn_lookup_error): Likewise.
2675         * parser.c (cp_parser_template_id): Likewise.
2676         * cvt.c (warn_ref_binding): Likewise.
2677         (convert_to_reference): Likewise.
2678         (ocp_convert): Likewise.
2679         (convert_to_void): Use error instead of pedwarn.
2680         * error.c (cp_cpp_error): Use pedantic_warning_kind.
2681         * decl.c (compute_array_index_type): Use constant_expression_error.
2682
2683 2008-03-01  Douglas Gregor  <doug.gregor@gmail.com>
2684
2685         * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
2686         that auto is either a storage class or a simple type specifier,
2687         depending on the dialect.
2688         (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
2689         specifier in C++98 mode, error in C++0x mode (since we don't
2690         support auto as a type specifier, yet).
2691         (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
2692         storage specifier in C++0x mode.
2693         (cp_parser_simple_type_specifier): Parse `auto' as a
2694         simple-type-specifier, but error because we don't support it yet.
2695
2696 2008-02-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2697
2698         * parser.c (cp_parser_nonclass_name): New.
2699         (cp_parser_pseudo_destructor_name): Use it instead of
2700         cp_parser_type_name.
2701         (cp_parser_type_name): Move code to cp_parser_nonclass_name.
2702
2703 2008-02-29  Tom Tromey  <tromey@redhat.com>
2704
2705         * parser.c (struct cp_token) <input_file_stack_index>: Remove.
2706         (cp_lexer_get_preprocessor_token): Update.
2707         (cp_lexer_set_source_position_from_token): Don't call
2708         restore_input_file_stack.
2709         * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
2710
2711 2008-02-28  Richard Guenther  <rguenther@suse.de>
2712
2713         Revert:
2714         2008-02-26  Richard Guenther  <rguenther@suse.de>
2715
2716         * decl.c (duplicate_decls): Remove decl from global mapping
2717         before ggc_freeing it.
2718
2719 2008-02-27  Jakub Jelinek  <jakub@redhat.com>
2720
2721         PR c++/35368
2722         * rtti.c: Include c-pragma.h.
2723         (push_abi_namespace, pop_abi_namespace): New functions.
2724         (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
2725         create_tinfo_types, emit_support_tinfos): Use them.
2726         * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
2727
2728 2008-02-26  Jason Merrill  <jason@redhat.com>
2729
2730         PR c++/35315
2731         * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
2732         to name the struct for linkage purposes even if it has attributes.
2733         (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
2734
2735 2008-02-26  Tom Tromey  <tromey@redhat.com>
2736
2737         * parser.c (eof_token): Remove old location code.
2738         (check_empty_body): Remove test of USE_MAPPED_LOCATION.
2739         * decl2.c (generate_ctor_or_dtor_function): Remove old location
2740         code.
2741         (cp_write_global_declarations): Likewise.
2742         * lex.c (cxx_init): Remove old location code.
2743         (handle_pragma_implementation): Remove test of
2744         USE_MAPPED_LOCATION.
2745         * pt.c (tsubst): Remove old location code.
2746         * error.c (cp_print_error_function): Remove test of
2747         USE_MAPPED_LOCATION.
2748         * decl.c (pop_label): Remove old location code.
2749         (finish_function): Likewise.
2750
2751 2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2752
2753         PR 26264
2754         * call.c (magic_varargs_p):  Remove BUILT_IN_STDARG_START.
2755
2756 2008-02-26  Richard Guenther  <rguenther@suse.de>
2757
2758         * decl.c (duplicate_decls): Remove decl from global mapping
2759         before ggc_freeing it.
2760
2761 2008-02-26  Paolo Carlini  <pcarlini@suse.de>
2762
2763          PR c++/35323
2764          * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
2765
2766 2008-02-26  Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2767
2768         * typeck.c (build_class_member_access_expr): Add appropriate
2769         OPT_W* parameter to warning.
2770         (build_reinterpret_cast_1): Likewise.
2771         * name-lookup.c (push_overloaded_decl): Likewise.
2772
2773 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
2774
2775          PR c++/35333
2776          * error.c (dump_expr): Handle CONJ_EXPR.
2777
2778 2008-02-25  Paolo Carlini  <pcarlini@suse.de>
2779
2780          PR c++/35338
2781          * error.c (dump_type): Handle FIXED_POINT_TYPE.
2782         (dump_expr): Handle FIXED_CST.
2783
2784 2008-02-24  Jason Merrill  <jason@redhat.com>
2785
2786         * parser.c (cp_parser_declaration): Handle "inline namespace".
2787         (cp_parser_namespace_definition): Likewise.
2788
2789         PR c++/33486
2790         * name-lookup.c (arg_assoc_namespace): Look down into inline
2791         namespaces, too.
2792
2793 2008-02-23  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2794
2795         * typeck.c (check_for_casting_away_constness): Use 1 single
2796         argument, the type of cast, to decide what diagnostics generate.
2797         (build_static_cast_1): Remove unused code. Update call to
2798         check_for_casting_away_constness.
2799         (build_reinterpret_cast_1): Update call to
2800         check_for_casting_away_constness.
2801         (build_const_cast_1): Likewise.
2802
2803 2008-02-24  Paolo Carlini  <pcarlini@suse.de>
2804
2805         * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
2806         VEC_NEW_EXPR), forward to pp_expression.
2807         * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
2808
2809 2008-02-24  Danny Smith  <dannysmith@users.sourceforge.net>
2810
2811         PR c++/34749
2812         * friend.c (do_friend): Call cplus_decl_attributes earlier.
2813
2814 2008-02-22  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2815
2816         PR C++/34715
2817         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
2818         template decls' function decl.
2819
2820 2008-02-22  Paolo Carlini  <pcarlini@suse.de>
2821
2822         PR c++/35282
2823         Revert:
2824         2008-02-14  Paolo Carlini  <pcarlini@suse.de>
2825
2826          PR c++/28743
2827          * pt.c (determine_specialization): In case of function templates,
2828         when the type of DECL does not match FN there is no match.
2829
2830 2008-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2831
2832         PR c/19999
2833         * typeck.c (build_binary_op): Warn about floating point
2834         comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
2835
2836 2008-02-19  Jason Merrill  <jason@redhat.com>
2837
2838         PR c++/34950
2839         * pt.c (resolve_overloaded_unification): Set processing_template_decl
2840         while we look for possible bindings.
2841
2842 2008-02-19  Jakub Jelinek  <jakub@redhat.com>
2843
2844         PR c++/35028
2845         * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
2846
2847         PR c++/34964
2848         PR c++/35244
2849         * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
2850         vars.  Afterwards ensure v is VAR_DECL.
2851
2852         PR c++/35078
2853         * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
2854         call cp_finish_decl.
2855         * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
2856         early.
2857
2858 2008-02-15  Douglas Gregor  <doug.gregor@gmail.com>
2859
2860         PR c++/35023
2861         PR c++/35024
2862         PR c++/35026
2863         * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
2864         is error_mark_node, return an error early.
2865         (find_parameter_packs_r): Pass the pointer set along to recursive
2866         calls of cp_walk_subtrees; don't try to manage the pointer set
2867         ourselves.
2868         (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
2869         (make_pack_expansion): Ditto.
2870         (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
2871         a second pass through the tree with find_parameter_packs_r; that
2872         second pass no longer does anything.
2873         (push_template_decl_real): If we have an erroneous declaration,
2874         set its type to error_mark_node before returning an error.
2875
2876 2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>
2877
2878         PR c++/34050
2879         * pt.c (tsubst_initializer_list): Deal with the use of
2880         VOID_TYPE_NODE to indicate value-initialization of the bases.
2881
2882 2008-02-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2883             Jason Merrill  <jason@redhat.com>
2884
2885         PR c++/5645
2886         PR c++/11159
2887         * class.c (type_has_user_nondefault_constructor): New fn.
2888         * cp-tree.h: Declare it.
2889         * init.c (emit_mem_initializers): Use it for -W warning about
2890         missing base initializer.
2891
2892 2008-02-14  Paolo Carlini  <pcarlini@suse.de>
2893
2894          PR c++/28743
2895          * pt.c (determine_specialization): In case of function templates,
2896         when the type of DECL does not match FN there is no match.
2897
2898 2008-02-13  Jakub Jelinek  <jakub@redhat.com>
2899             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2900
2901         PR c++/35138
2902         * parser.c (cp_parser_pseudo_destructor_name): If next tokens
2903         are not identifier :: ~, return before calling cp_parser_type_name.
2904
2905 2008-02-13  Jason Merrill  <jason@redhat.com>
2906
2907         PR c++/34962, c++/34937, c++/34939
2908         * decl2.c (is_late_template_attribute): Always defer attributes
2909         vector_size and weak.
2910
2911         PR c++/34774
2912         * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
2913         of enumerators, too.
2914
2915 2008-02-12  Jason Merrill  <jason@redhat.com>
2916
2917         PR c++/34824
2918         * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
2919         if we're doing conversions to call a user-defined conversion function.
2920
2921 2008-02-12  Steven Bosscher  <steven@gcc.gnu.org>
2922
2923         PR c++/29048
2924         * semantics.c (finish_qualified_id_expr): Avoid duplicate access
2925         check here, too.
2926
2927 2008-02-12  Jakub Jelinek  <jakub@redhat.com>
2928
2929         PR c++/34862
2930         * init.c (build_new_1): Don't create placement_expr before
2931         constructing alloc_call.  Verify that the pointer is passed by
2932         value to operator new.
2933
2934 2008-02-11  Jason Merrill  <jason@redhat.com>
2935
2936         PR c++/35097
2937         * pt.c (tsubst): Don't look up a template typedef in an explicit
2938         specialization.
2939
2940 2008-02-11  Douglas Gregor  <doug.gregor@gmail.com>
2941
2942         PR c++/35113
2943         * tree.c (cp_build_qualified_type_real): When building a
2944         cv-qualified array type, build it as a unique type with
2945         build_cplus_array_type_1 and then adopt the unqualified type's
2946         main variant.
2947
2948 2008-02-11  Paolo Carlini  <pcarlini@suse.de>
2949
2950         PR c++/35077
2951         * decl.c (groktypename): Check grokdeclarator return.
2952
2953 2008-02-10  Jason Merrill  <jason@redhat.com>
2954
2955         PR c++/34094
2956         * decl2.c (cp_write_global_declarations): Don't write out static
2957         data members with DECL_IN_AGGR_P set.
2958
2959 2008-02-08  Jason Merrill  <jason@redhat.com>
2960
2961         PR c++/35116
2962         * tree.c (build_target_expr_with_type): Handle void initializer.
2963         (bot_manip): Remap slot before recursing.
2964
2965 2008-02-06  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
2966
2967         PR other/35107
2968         * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
2969
2970 2008-02-06  Alexandre Oliva  <aoliva@redhat.com>
2971
2972         PR c++/35056
2973         * tree.c: Include tree-flow.h.
2974         (build_target_expr): Check type compatibility.
2975         * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
2976         * call.c (convert_like_real): Convert bitfield to expected type.
2977
2978 2008-02-06  Douglas Gregor  <doug.gregor@gmail.com>
2979
2980         PR c++/35049
2981         PR c++/35096
2982         * typeck.c (structural_comptypes): Call cp_comptypes.
2983         (comptypes): New; called from the C/C++ common bits to perform
2984         strict checks.
2985         (cp_comptypes): Renamed from comptypes, which is already used,
2986         with a different signature, by the C++ front end.
2987         (build_reinterpret_cast_1): Call cp_comptypes.
2988         (ptr_reasonably_similar): Ditto.
2989         * decl.c (decls_match): Ditto.
2990         * cvt.c (convert_to_reference): Ditto.
2991         * cp-tree.h (same_type_p): Ditto.
2992         (same_or_base_type_p): Ditto.
2993         (comptypes): Rename to cp_comptypes.
2994         * pt.c (canonical_type_parameter): Call cp_comptypes.
2995
2996 2008-02-05  Jakub Jelinek  <jakub@redhat.com>
2997
2998         PR c++/33553
2999         * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
3000         value dependent expression.
3001
3002 2008-02-05  Douglas Gregor  <doug.gregor@gmail.com>
3003
3004         PR c++/35074
3005         * decl2.c (save_template_attributes): When we're modifying the
3006         TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
3007         all of the other variants to add those same attributes. Otherwise,
3008         the main variant will be inconsistent with those other variants.
3009
3010 2008-02-04  Richard Guenther  <rguenther@suse.de>
3011
3012         PR java/35035
3013         * decl.c (record_builtin_java_type): Make jboolean a
3014         integer type again where its mode doesn't match that of bool.
3015
3016 2008-02-02  Jason Merrill  <jason@redhat.com>
3017             Mark Mitchell  <mark@codesourcery.com>
3018
3019         PR c++/33916
3020         * init.c (build_value_init_1): New function.
3021         (build_value_init): New function.
3022         * typeck2.c (build_functional_cast): Call it.
3023         * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
3024
3025         * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
3026         TYPE_HAS_CONSTRUCTOR.
3027         * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
3028         add_implicitly_declared_members): Adjust.
3029         (check_field_decls): Adjust. Remove warnings about reference/const
3030         in class without constructor.
3031         (check_bases_and_members): Adjust.  Give those warnings here instead.
3032         * decl.c (fixup_anonymous_aggr): Adjust.
3033         (check_initializer): Adjust, clarify logic slightly.
3034         (grok_special_member_properties): Adjust, only set if user-provided.
3035         * rtti.c (create_tinfo_types): Don't set.
3036         * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
3037         Use same_type_ignoring_top_level_qualifiers_p.
3038         * pt.c (check_explicit_specialization): Adjust.
3039         (instantiate_class_template): Adjust.
3040
3041 2008-01-31  Douglas Gregor  <doug.gregor@gmail.com>
3042             Jakub Jelinek  <jakub@redhat.com>
3043
3044         PR c++/34935
3045         PR c++/34936
3046         * typeck.c (structural_comptypes): Handle comparisons of
3047         VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
3048         REAL_TYPE nodes.
3049         * mangle.c (write_builtin_type): Map down to the canonical type,
3050         which will be one of the predefined type nodes.
3051
3052 2008-01-29  Michael Meissner  <michael.meissner@amd.com>
3053
3054         PR 35004
3055         * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
3056         bits to allow for expansion of the number of middle end tree
3057         codes.
3058
3059 2008-01-29  Douglas Gregor  <doug.gregor@gmail.com>
3060
3061         PR c++/34055
3062         PR c++/34103
3063         PR c++/34219
3064         PR c++/34606
3065         PR c++/34753
3066         PR c++/34754
3067         PR c++/34755
3068         PR c++/34919
3069         PR c++/34961
3070         * typeck.c (check_return_expr): Tweak call to
3071         check_for_bare_parameter_packs.
3072         * class.c (add_method): Be careful with error_mark_nodes.
3073         * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
3074         signature.
3075         * pt.c (struct find_parameter_pack_data): Remove
3076         SET_PACKS_TO_ERROR.
3077         (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
3078         (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
3079         (make_pack_expansion): Ditto.
3080         (check_for_bare_parameter_packs): Parameter is now a tree, not a
3081         tree*.
3082         (process_template_parm): Tweak call to
3083         check_for_bare_parameter_packs.
3084         (push_template_decl_real): Tweak calls to
3085         check_for_bare_parameter_packs. If bare parameter packs are found
3086         in the list of exceptions, clear out that list after giving an
3087         error.
3088         * semantics.c (finish_cond): Tweak call to
3089         check_for_bare_parameter_packs.
3090         (finish_expr_stmt): Ditto.
3091         (finish_for_expr): Ditto.
3092         (finish_switch_cond): Ditto.
3093         (finish_mem_initializers): Ditto.
3094         (finish_member_declaration): Ditto.
3095         (finish_static_assert): Check for bare parameter packs in the
3096         condition.
3097         * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
3098         attributes of a declaration.
3099         * parser.c (cp_parser_using_declaration): Tweak call to
3100         check_for_bare_parameter_packs.
3101         (cp_parser_base_clause): Ditto.
3102
3103 2008-01-28  Jason Merrill  <jason@redhat.com>
3104
3105         PR c++/35007
3106         * class.c (build_base_path): Fix !want_pointer case.
3107
3108 2008-01-27  Jason Merrill  <jason@redhat.com>
3109
3110         PR c++/27177
3111         * class.c (build_base_path): Fix previous change.
3112
3113 2008-01-26  Jakub Jelinek  <jakub@redhat.com>
3114
3115         PR c++/34965
3116         * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
3117         and TRUTH_XOR_EXPR.
3118
3119 2008-01-26  Richard Guenther  <rguenther@suse.de>
3120
3121         PR c++/34235
3122         * typeck.c (build_binary_op): Remove code to shorten compares.
3123
3124 2008-01-25  Richard Guenther  <rguenther@suse.de>
3125
3126         PR c++/33887
3127         * decl.c (record_builtin_java_type): Make __java_boolean
3128         a variant of bool.
3129         * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
3130         after TYPE_MAIN_VARIANT check.
3131
3132 2008-01-25  Jason Merrill  <jason@redhat.com>
3133
3134         PR c++/27177
3135         * class.c (build_base_path): Don't mess with virtual access if
3136         skip_evaluation.
3137         * call.c (standard_conversion): Don't check whether source type
3138         is complete.
3139
3140         * decl2.c (is_late_template_attribute): Don't defer attribute
3141         visibility just because the type is dependent.
3142
3143 2008-01-25  Jason Merrill  <jason@redhat.com>
3144             Mark Mitchell  <mark@codesourcery.com>
3145
3146         PR c++/31780
3147         * call.c (standard_conversion): Allow conversion from integer/real
3148         to complex.
3149         (compare_ics): Such a conversion is worse than a normal arithmetic
3150         conversion.
3151
3152 2008-01-25  Richard Guenther  <rguenther@suse.de>
3153
3154         PR c++/33887
3155         * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
3156         to true.
3157
3158 2008-01-24  Paolo Carlini  <pcarlini@suse.de>
3159
3160          PR c++/34603
3161          * pt.c (push_template_decl_real): Return error_mark_node in case
3162         of template definition of non-template.
3163
3164 2008-01-24  Jason Merrill  <jason@redhat.com>
3165
3166         PR c++/34913
3167         * decl2.c (is_late_template_attribute): Defer any attribute with
3168         dependent args.  Also defer type attributes if the type is dependent.
3169
3170 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
3171             Alexandre Oliva  <aoliva@redhat.com>
3172
3173         PR c++/33984
3174         * call.c (reference_binding): For bitfields use the declared bitfield
3175         type.
3176         (add_builtin_candidates): Likewise.
3177         * class.c (layout_class_type): For bitfields copy over the
3178         original type quals.
3179
3180 2008-01-22  Jason Merrill  <jason@redhat.com>
3181
3182         PR c++/28560
3183         * decl.c (groktypename): Also ignore attributes on dependent
3184         possibly-class types.
3185
3186         PR c++/34912
3187         * friend.c (do_friend): Check for prior declaration of a friend
3188         function of a local class.
3189         * name-lookup.c (lookup_name_innermost_nonclass_level):
3190         No longer static.
3191         * name-lookup.h: Declare it.
3192
3193 2008-01-22  Tom Tromey  <tromey@redhat.com>
3194
3195         PR c++/34829:
3196         * init.c (build_new_1): Only disallow Java aggregates.
3197
3198 2008-01-22  Jakub Jelinek  <jakub@redhat.com>
3199
3200         PR c++/34607
3201         * semantics.c (finish_omp_for): Don't call c_finish_omp_for
3202         if decl or init is error_mark_node.
3203
3204         PR c++/34918
3205         * error.c (dump_expr): Handle VECTOR_CST.
3206
3207 2008-01-21  Jason Merrill  <jason@redhat.com>
3208
3209         PR c++/33959
3210         * pt.c (tsubst_aggr_type): Make sure our context is complete.
3211
3212         PR c++/34573
3213         * pt.c (retrieve_local_specialization): Robustify.
3214         (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
3215
3216         PR c++/34846
3217         * pt.c (tsubst): Only call retrieve_local_specialization if the
3218         original typedef was in a function template.
3219
3220         PR c++/34196
3221         * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
3222
3223 2008-01-21  Richard Guenther  <rguenther@suse.de>
3224
3225         PR c++/34850
3226         * error.c (cp_print_error_function): Deal with recursive
3227         BLOCK trees.
3228
3229 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
3230
3231          PR c++/34891
3232          * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
3233
3234 2008-01-20  Paolo Carlini  <pcarlini@suse.de>
3235
3236          PR c++/34776
3237         PR c++/34486
3238          * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
3239         on non-IS_AGGR_TYPE scope.
3240         (constructor_name_p): Assert IS_AGGR_TYPE.
3241
3242 2008-01-18  Ian Lance Taylor  <iant@google.com>
3243
3244         PR c++/33407
3245         * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
3246         (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
3247         DECL_IS_OPERATOR_NEW flag.
3248
3249 2008-01-16  Richard Guenther  <rguenther@suse.de>
3250
3251         PR c++/33819
3252         * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
3253         for conversions to type variants.
3254
3255 2008-01-15  Andreas Tobler  <a.tobler@schweiz.org>
3256
3257         * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
3258         declaration and code.  Update copyright year.
3259
3260 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3261
3262         PR c++/34399
3263         * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
3264         know we have a class type.
3265
3266 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3267
3268         PR c++/34751
3269         * pt.c (coerce_template_parameter_pack): When substituting into
3270         the type of a non-type template parameter pack. use the
3271         deduced/substituted arguments.
3272         * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
3273         can be a parameter pack with the ellipsis following it.  When we
3274         have an erroneous declaration, allow it to be a parameter pack.
3275         (cp_parser_template_parameter): Complain about default
3276         arguments on non-type template parameter packs, and parse them
3277         using the new cp_parser_default_argument.
3278         (cp_parser_parameter_declaration): Complain about parameter packs
3279         with default arguments. Move parsing of default arguments into a
3280         new function, cp_parser_default_argument.
3281         (cp_parser_default_argument): New; extracted from
3282         cp_parser_parameter_declaration.
3283
3284 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3285
3286         PR c++/34051
3287         PR c++/34055
3288         PR c++/34102
3289         PR c++/34103
3290         * typeck.c (check_return_expr): If there are bare parameter packs
3291         in the return value, set it to error_mark_node.
3292         * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
3293         * pt.c (find_parameter_packs_r): Look at the type of
3294         IDENTIFIER_NODEs (e.g., for user-defined conversions).
3295         (check_for_bare_parameter_packs): Flip the result: now returns
3296         TRUE when there were bare parameter packs, FALSE otherwise.
3297         (push_template_decl_real): Deal with flipped result of
3298         check_for_bare_parameter_packs.
3299         * semantics.c (finish_cond): If there are bare parameter packs in
3300         the conditional, set it to error_mark_node.
3301         (finish_expr_stmt): If there are bare parameter packs in the
3302         expression, set it to error_mark_node.
3303         (finish_for_expr): Ditto.
3304         (finish_switch_cond): If there are bare parameter packs in
3305         the conditional, set it to error_mark_node.
3306         (finish_mem_initializers): If there are bare parameter packs in
3307         the member initializer, set it to error_mark_node.
3308         (finish_member_declaration): Check the attributes of the
3309         declaration for bare parameter packs, and remove the attributes if
3310         any have bare parameter packs.
3311         * parser.c (cp_parser_using_declaration): Check the using
3312         declaration for bare parameter packs.
3313         (cp_parser_base_clause): If there are bare parameter packs in a
3314         base specifier, don't add it to the chain.
3315
3316 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3317
3318         PR c++/34314
3319         * error.c (dump_simple_decl): Display ellipsis for template
3320         non-type parameter packs.
3321         (dump_decl): Display ellipsis for template type parameter packs.
3322         (dump_template_decl): Display ellipsis for template template
3323         parameter packs.
3324         * pt.c (redeclare_class_template): When redeclaring a class
3325         template, check for collisions between template parameters and
3326         template parameter packs.
3327
3328 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3329
3330         PR c++/33964
3331         * pt.c (process_partial_specialization): Don't mark template
3332         parameters that occur in non-deduced contexts.
3333         (struct pair_fn_data): Add include_nondeduced_p.
3334         (for_each_template_parm_r): Only visit non-deduced contexts if
3335         include_nondeduced_p is set.
3336         (for_each_template_parm): Added parameter include_nondeduced_p,
3337         which states whether template parameters found in non-deduced
3338         contexts should be visited.
3339         (uses_template_parms): Visit all template parameters, even those
3340         in non-deduced contexts.
3341
3342 2008-01-15  Douglas Gregor  <doug.gregor@gmail.com>
3343
3344         PR c++/34052
3345         * pt.c (check_default_tmpl_args): Check for parameter packs that
3346         aren't at the end of a primary template.
3347         (push_template_decl_real): Remove check for parameter packs that
3348         aren't at the end of a primary template; that now happens in
3349         check_default_tmpl_args.
3350         * semantics.c (finish_template_template_parm): Use
3351         check_default_tmpl_args to check for errors in the template
3352         parameter list.
3353
3354 2008-01-12  Doug Kwan  <dougkwan@google.com>
3355
3356         * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
3357         instead of OPT_Wreturn_type in warning due to ignored return type
3358         qualifiers.
3359         * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
3360         instead of OPT_Wreturn_type in warning due to ignored return type
3361         qualifiers.
3362
3363 2008-01-08  Jakub Jelinek  <jakub@redhat.com>
3364
3365         PR c++/33890
3366         * semantics.c (finish_omp_for): Don't call
3367         fold_build_cleanup_point_expr if processing_template_decl.
3368
3369 2008-01-04  Paolo Carlini  <pcarlini@suse.de>
3370             Jakub Jelinek  <jakub@redhat.com>
3371
3372         PR c++/34611
3373         * error.c (dump_template_argument): Deal with TREE_LIST.
3374
3375 2008-01-01  Douglas Gregor  <doug.gregor@gmail.com>
3376
3377         * parser.c (cp_parser_check_decl_spec): Don't warn about "long
3378         long" in C++0x mode; change the warning to note that "long long"
3379         is only unsupported in C++98 mode.
3380
3381 2007-12-20  Jason Merrill  <jason@redhat.com>
3382
3383         PR c++/34111
3384         * call.c (standard_conversion): Derived-to-base is considered a
3385         standard conversion.
3386
3387 2007-12-19  Jakub Jelinek  <jakub@redhat.com>
3388
3389         PR c++/34513
3390         * parser.c (cp_parser_omp_parallel): For non-combined parallel
3391         call cp_parser_statement rather than
3392         cp_parser_already_scoped_statement.
3393
3394 2007-12-18  Jason Merrill  <jason@redhat.com>
3395
3396         PR c++/34206
3397         * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
3398         use template parms.
3399         (dependent_type_p_r): Handle the domain of an array.
3400
3401 2007-12-18  Douglas Gregor  <doug.gregor@gmail.com>
3402              Jakub Jelinek  <jakub@redhat.com>
3403
3404         PR c++/32565
3405         PR c++/33943
3406         PR c++/33965
3407         * pt.c (template_template_parm_bindings_ok_p): New; verifies
3408         bindings of template template parameters after all template
3409         arguments have been deduced.
3410         (coerce_template_parms): Don't complain when COMPLAIN doesn't
3411         include tf_error.
3412         (fn_type_unification): Use template_template_parm_bindings_ok_p.
3413         (unify): Deal with variadic, bound template template parameters.
3414         (get_class_bindings): Use template_template_parm_bindings_ok_p.
3415
3416 2007-12-18  Jakub Jelinek  <jakub@redhat.com>
3417
3418         PR c++/34488
3419         * decl.c (grokdeclarator): Reject friend sfk_constructor
3420         FUNCTION_TYPE.
3421
3422 2007-12-17  Jakub Jelinek  <jakub@redhat.com>
3423
3424         PR c/34506
3425         * parser.c (cp_parser_omp_all_clauses): Accept optional comma
3426         in between clauses.
3427
3428 2007-12-15  Alexandre Oliva  <aoliva@redhat.com>
3429
3430         PR debug/7081
3431         * cp-lang.c (cp_classify_record): New.
3432         (LANG_HOOKS_CLASSIFY_RECORD): Override.
3433
3434 2007-12-11  Jakub Jelinek  <jakub@redhat.com>
3435
3436         PR c++/34238
3437         * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
3438
3439         PR c++/34364
3440         * rtti.c (build_dynamic_cast): Call convert_from_reference even for
3441         dynamic_cast in a template.
3442
3443 2007-12-10  Simon Martin  <simartin@users.sourceforge.net>
3444
3445         PR c++/34059
3446         * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
3447         MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
3448
3449 2007-12-10  Jakub Jelinek  <jakub@redhat.com>
3450
3451         PR c++/34395
3452         * error.c (dump_type_prefix, dump_type_suffix): Handle
3453         TYPE_PACK_EXPANSION.
3454
3455         PR c++/34394
3456         * error.c (dump_expr): Handle ABS_EXPR.
3457
3458 2007-12-09  Jakub Jelinek  <jakub@redhat.com>
3459
3460         PR c++/34178
3461         PR c++/34340
3462         * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
3463         in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
3464         Return 2 also if DECL_EXPLICIT_INSTANTIATION.
3465         * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
3466         flag_use_repository and repo_emit_p returned 2.
3467
3468 2007-12-06  Jakub Jelinek  <jakub@redhat.com>
3469
3470         PR c++/34336
3471         * tree.c (stabilize_call, stabilize_init): Do nothing if
3472         processing_template_decl.
3473
3474 2007-12-05  Jakub Jelinek  <jakub@redhat.com>
3475
3476         PR c++/34271
3477         * semantics.c (finish_decltype_type): For SCOPE_REF issue an
3478         error instead of assertion failure.
3479         * parser.c (cp_parser_decltype): If closing paren is not found,
3480         return error_mark_node.
3481
3482 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3483
3484         PR c++/34101
3485         * name-lookup.c (arg_assoc_template_arg): Recurse on argument
3486         packs.
3487         (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
3488         since arg_assoc_template_arg will deal with them (better).
3489
3490 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3491
3492         PR c++/33509
3493         * pt.c (tsubst_exception_specification): Handle substitutions into
3494         member templates, where tsubst_pack_expansion returns a
3495         TYPE_PACK_EXPANSION.
3496
3497 2007-12-04  Douglas Gregor  <doug.gregor@gmail.com>
3498
3499         PR c++/33091
3500         * pt.c (unify_pack_expansion): If we didn't deduce any actual
3501         bindings for the template parameter pack, don't try to keep the
3502         empty deduced arguments.
3503         (unify): If a parameter is a template-id whose template argument
3504         list contains a pack expansion that is not at the end, then we
3505         cannot unify against that template-id.
3506
3507 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
3508
3509          PR c++/34061
3510          * pt.c (current_template_args): Use error_operand_p.
3511
3512 2007-12-02  Paolo Carlini  <pcarlini@suse.de>
3513
3514          PR c++/34273
3515          * error.c (dump_decl): Handle TREE_BINFO.
3516
3517 2007-12-01  Ollie Wild  <aaw@google.com>
3518
3519         PR c++/8171
3520         * typeck.c (build_binary_op): Add conversion of pointers to function
3521         members appearing as operands to the equality operators.
3522
3523 2007-11-30  Jakub Jelinek  <jakub@redhat.com>
3524
3525         PR c++/34275
3526         * error.c (dump_expr): Handle OBJ_TYPE_REF.
3527
3528 2007-11-29  Jakub Jelinek  <jakub@redhat.com>
3529
3530         PR c++/34270
3531         * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
3532         in templates.
3533         * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
3534         Likewise.
3535
3536         PR c++/34267
3537         PR c++/34268
3538         * parser.c (cp_parser_decltype): Don't call finish_id_expression
3539         on ~type.
3540         * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
3541         and ~type early.
3542
3543 2007-11-27  Jakub Jelinek  <jakub@redhat.com>
3544
3545         PR tree-optimization/34181
3546         * method.c (use_thunk): Don't inline the call in the thunk.
3547
3548         PR c++/34213
3549         * tree.c (decl_linkage): Static data members and static member
3550         functions in anonymous ns classes are lk_external.
3551
3552 2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>
3553
3554         PR c++/34081
3555         * decl.c (start_preparsed_function): Pass
3556         processing_template_decl for the new allocate_struct_function
3557         parameter.
3558
3559 2007-11-25  Richard Guenther  <rguenther@suse.de>
3560
3561         * decl.c (poplevel): Use BLOCK_CHAIN.
3562
3563 2007-11-24  Ollie Wild  <aaw@google.com>
3564
3565         * typeck.c (delta_from_ptrmemfunc): New function.
3566         (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
3567         (build_binary_op): Call delta_from_ptrmemfunc.
3568
3569 2007-11-23  Jakub Jelinek  <jakub@redhat.com>
3570
3571         PR c++/30293
3572         PR c++/30294
3573         * decl.c (cp_finish_decl): Disallow variable or field
3574         definitions if extern "Java" aggregates.
3575         (grokparms): Disallow parameters with extern "Java"
3576         aggregates.
3577         (check_function_type): Disallow function return values
3578         with extern "Java" aggregates.
3579         * init.c (build_new_1): Disallow placement new with
3580         extern "Java" aggregates.
3581
3582 2007-11-23  Mark Mitchell  <mark@codesourcery.com>
3583             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3584
3585         PR c++/5310
3586         * call.c (convert_like_real): Build a zero constant when __null is
3587         converted to an integer type.
3588
3589 2007-11-22  Jakub Jelinek  <jakub@redhat.com>
3590
3591         PR c++/34094
3592         * decl2.c (cp_write_global_declarations): Issue error about static
3593         data members in anonymous namespace which are declared and used,
3594         but not defined.
3595
3596 2007-11-20  Jakub Jelinek  <jakub@redhat.com>
3597
3598         PR c++/34089
3599         * parser.c (cp_parser_class_head): Reject function template ids.
3600
3601         PR c++/28879
3602         * tree.c (build_cplus_array_type_1): Don't pass any VLA types
3603         when processing_template_decl to build_array_type.
3604
3605         PR c++/33962
3606         * pt.c (more_specialized_fn): Don't segfault if one or
3607         both argument list end with ellipsis.
3608
3609 2007-11-18  Jakub Jelinek  <jakub@redhat.com>
3610
3611         PR c++/30988
3612         * semantics.c (finish_call_expr): Set
3613         current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
3614         or OVERLOAD with all noreturn functions.
3615
3616 2007-11-16  Jakub Jelinek  <jakub@redhat.com>
3617
3618         PR c++/34100
3619         * pt.c (apply_late_template_attributes): Do nothing if decl's type is
3620         error_mark_node.
3621
3622 2007-11-13  Jakub Jelinek  <jakub@redhat.com>
3623
3624         PR c++/34054
3625         PR c++/34056
3626         PR c++/34057
3627         PR c++/34058
3628         PR c++/34060
3629         * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
3630         set to error_mark_node the outermost POINTER_TYPE to the pack if
3631         it is seen in a POINTER_TYPE.
3632         (push_template_decl_real): If check_for_bare_parameter_packs
3633         fails for function return type, set the return type to
3634         integer_type_node.  If check_for_bare_parameter_packs failed
3635         for non-function, return error_mark_node.
3636
3637         PR c++/29225
3638         * call.c (build_new_op): Call resolve_args before calling
3639         build_over_call.
3640
3641 2007-11-11  Tom Tromey  <tromey@redhat.com>
3642
3643         PR c++/17577:
3644         * lex.c (handle_pragma_implementation): Use cpp_included_before.
3645
3646 2007-11-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3647
3648         PR c++/8570
3649         * pt.c (redeclare_class_template): Update error message. Use a
3650         note to show the previous declaration.
3651         (tsubst_friend_class): Use the location of the friend template as
3652         the input location before calling redeclare_class_template.
3653
3654 2007-11-11  Jakub Jelinek  <jakub@redhat.com>
3655
3656         PR c++/34068
3657         * semantics.c (finish_pseudo_destructor_expr): Handle
3658         object == error_mark_node.
3659
3660 2007-11-10  Jakub Jelinek  <jakub@redhat.com>
3661
3662         PR c++/32241
3663         * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
3664         is not scalar type, let finish_class_member_access_expr handle
3665         diagnostics.  Pass BIT_NOT_EXPR argument to
3666         finish_pseudo_destructor_expr.  Handle SCOPE_REF properly.
3667
3668 2007-11-09  Douglas Gregor  <doug.gregor@gmail.com>
3669
3670         PR c++/33510
3671         * decl.c (cp_complete_array_type): If any of the initializer
3672         elements are pack expansions, don't compute the array size yet.
3673
3674 2007-11-08  Andrew Pinski  <pinskia@gmail.com>
3675
3676         PR c++/30297:
3677         * tree.c (decl_linkage): Fields have no linkage.
3678
3679 2007-11-08  Daniel Jacobowitz  <dan@codesourcery.com>
3680
3681         * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
3682
3683 2007-11-07  Douglas Gregor  <doug.gregor@gmail.com>
3684
3685         PR c++/33045
3686         PR c++/33837
3687         PR c++/33838
3688         * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
3689         Be careful with ERROR_MARK_NODEs.
3690         * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
3691         argument.
3692
3693 2007-11-07  Jakub Jelinek  <jakub@redhat.com>
3694
3695         PR c++/33501
3696         * call.c (build_over_call): Don't check TREE_ADDRESSABLE
3697         on incomplete type.
3698
3699 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
3700
3701         PR c++/33977
3702         PR c++/33886
3703         * tree.c (c_build_qualified_type): Define bridge to
3704         cp_build_qualified_type.
3705
3706 2007-11-06  Douglas Gregor  <doug.gregor@gmail.com>
3707
3708         PR c++/31439
3709         PR c++/32114
3710         PR c++/32115
3711         PR c++/32125
3712         PR c++/32126
3713         PR c++/32127
3714         PR c++/32128
3715         PR c++/32253
3716         PR c++/32566
3717         * typeck.c (check_return_expr): Pass address of retval to
3718         check_for_bare_parameter_packs.
3719         * class.c (build_base_field): Tolerate bases that have no layout
3720         due to errors.
3721         (end_of_base): Ditto.
3722         * tree.c (canonical_type_variant): Be careful with
3723         ERROR_MARK_NODE.
3724         * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
3725         tree*.
3726         * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
3727         which states whether parameter packs should be replaced with
3728         ERROR_MARK_NODE.
3729         (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
3730         possible. If set_packs_to_error is set true, replace the parameter
3731         pack with ERROR_MARK_NODE. Manage our own pointer sets.
3732         (uses_parameter_packs): Don't set parameter packs to
3733         ERROR_MARK_NODE.
3734         (check_for_bare_parameter_packs): Now takes a pointer to a tree,
3735         which may be modified (if it is a parameter pack). Instructs
3736         find_parameter_packs_r to replace parameter packs with
3737         ERROR_MARK_NODE (so that they won't cause errors later on).
3738         (process_template_parm): Pass pointer to
3739         check_for_bare_parameter_packs.
3740         (process_partial_specialization): Replace pack expansions before
3741         the end of the template argument list with ERROR_MARK_NODE.
3742         (push_template_decl_real): Pass pointer to
3743         check_for_bare_parameter_packs. Replace parameter packs not at the
3744         end of the template parameter list with ERROR_MARK_NODE.
3745         (convert_template_argument): Be more careful about using DECL_NAME
3746         on only declarations.
3747         (unify): Can't unify against ERROR_MARK_NODE.
3748         * semantics.c (finish_cond): Pass pointer to
3749         check_for_bare_parameter_packs.
3750         (finish_expr_stmt): Ditto.
3751         (finish_for_expr): Ditto.
3752         (finish_switch_cond): Pass pointer to
3753         check_for_bare_parameter_packs, and call it before we put the
3754         condition into the statement.
3755         (finish_mem_initializers): Pass pointer to
3756         check_for_bare_parameter_packs.
3757         (finish_member_declaration): Ditto.
3758         * parser.c (cp_parser_base_clause): Ditto.
3759
3760 2007-11-06  Jakub Jelinek  <jakub@redhat.com>
3761
3762         PR target/33168
3763         * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
3764         with the final TREE_READONLY flag in place.  processing_template_decl
3765         is known to be 0 in this part of function.
3766
3767         PR c++/33894
3768         * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
3769         OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
3770         * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
3771         * semantics.c (finish_omp_atomic): Revert most of the
3772         2007-02-05 changes, just keep the new representation of
3773         OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
3774
3775 2007-11-05  H.J. Lu  <hongjiu.lu@intel.com>
3776
3777         PR c++/33871
3778         * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
3779         local.
3780
3781 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
3782
3783         PR c++/33996
3784         PR c++/33235
3785         PR c++/33930
3786         * typeck.c (merge_types): Don't lose rvalue references when
3787         merging types.
3788         * call.c (build_over_call): Don't elide move constructors just
3789         because the copy constructor is trivial (!).
3790         (compare_ics): If comparing cv-qualifiers fails, we can still order
3791         based on binding lvalues vs. rvalues.
3792
3793 2007-11-05  Douglas Gregor  <doug.gregor@gmail.com>
3794
3795         PR c++/33939
3796         * pt.c (unify_pack_expansion): bring handling of function call
3797         arguments into line with type_unification_real.
3798
3799 2007-11-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3800
3801         * typeck.c (build_binary_op): Use pedwarn instead of error for
3802         consistency.
3803
3804 2007-11-05  Jakub Jelinek  <jakub@redhat.com>
3805
3806         PR c++/33836
3807         * parser.c (cp_parser_unary_expression): For &&label call
3808         cp_parser_non_integral_constant_expression and return error_mark_node
3809         if it returned true.
3810
3811         PR c++/33969
3812         * decl.c (grokdeclarator): Don't call build_memfn_type if type
3813         is neither FUNCTION_TYPE nor METHOD_TYPE.
3814
3815 2007-11-02  Jakub Jelinek  <jakub@redhat.com>
3816
3817         PR c++/33516
3818         * parser.c (cp_parser_nested_name_specifier_opt): Use
3819         TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
3820         typedef of currently open class.
3821
3822 2007-11-02  Paolo Carlini  <pcarlini@suse.de>
3823
3824         PR c++/33495
3825         * error.c (dump_expr): Deal specially with statements.
3826
3827 2007-11-01  Jason Merrill  <jason@redhat.com>
3828
3829         PR c++/30897
3830         * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
3831         template parms.
3832         (lookup_template_class): Use it to get the outer template args
3833         for instantiating one.
3834
3835         PR c++/29236
3836         * pt.c (reduce_template_parm_level): tsubst the parameters
3837         of a template template parm.
3838
3839 2007-11-01  Douglas Gregor  <doug.gregor@gmail.com>
3840
3841         PR c++/33955
3842         * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
3843
3844 2007-11-01  Jakub Jelinek  <jakub@redhat.com>
3845
3846         PR c++/32384
3847         * parser.c (cp_parser_postfix_dot_deref_expression): If
3848         POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
3849         first and if that succeeds and type is SCALAR_TYPE_P, create
3850         PSEUDO_DTOR_EXPR.
3851
3852         PR c++/32260
3853         * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
3854         (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
3855         as for std::type_info.
3856
3857 2007-10-31  Paolo Carlini  <pcarlini@suse.de>
3858
3859         PR c++/33494
3860         * cxx-pretty-print.c (pp_cxx_typeid_expression,
3861         pp_cxx_delete_expression): Change to static linkage.
3862         * cxx-pretty-print.h: Adjust declarations.
3863         * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
3864         MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
3865         MODOP_EXPR): Forward to pp_expression.
3866
3867         * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
3868         Fix typo.
3869
3870 2007-10-31 Christian Bruel  <christian.bruel@st.com>
3871             Mark Mitchell  <mark@codesourcery.com>
3872
3873         PR c++/19531
3874         * typeck.c (check_return_expr): Don't set named_return_value_okay_p
3875         if retval is volatile.
3876
3877 2007-10-30  Jakub Jelinek  <jakub@redhat.com>
3878
3879         PR c++/33616
3880         * decl2.c (build_offset_ref_call_from_tree): Call
3881         build_non_dependent_expr on object prior to building ADDR_EXPR from it
3882         if FN is DOTSTAR_EXPR.
3883
3884 2007-10-30  Douglas Gregor  <doug.gregor@gmail.com>
3885
3886         PR c++/31993
3887         PR c++/32252
3888         * pt.c (find_parameter_packs_r): Fix typo in comment.
3889         (convert_template_argument): Look at the pattern of a pack
3890         expansion to determine what kind of entity we're converting.
3891         (coerce_template_parameter_pack): When we have coerced a non-type
3892         template parameter pack, substitute into the type of that pack.
3893         (tsubst_pack_expansion): When our substitution of a parameter pack
3894         is a "trivial" substitution of itself, just substitute into the
3895         pack expansion rather than actually expanding.
3896
3897 2007-10-29  Jakub Jelinek  <jakub@redhat.com>
3898
3899         PR c++/33841
3900         * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
3901         for non-integral type bitfields.  Return true if bitfield is correct, false
3902         error has been diagnosed.
3903         (check_field_decls): If check_bitfield_decl returned false, call also
3904         check_field_decl.
3905
3906 2007-10-28  Paolo Carlini  <pcarlini@suse.de>
3907             Mark Mitchell  <mark@codesourcery.com>
3908
3909         PR c++/30659
3910         * pt.c (do_decl_instantiation): If the VAR_DECL is not a
3911         class member error out and return.
3912
3913 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
3914
3915         * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
3916         to current_function_decl rather than 0.
3917
3918         PR c++/33844
3919         * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
3920         ->* rather than .*.
3921         * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
3922
3923 2007-10-27  Jason Merrill  <jason@redhat.com>
3924
3925         PR c++/5247
3926         * call.c (convert_default_arg): Detect recursion.
3927
3928 2007-10-27  Jakub Jelinek  <jakub@redhat.com>
3929
3930         PR c++/33842
3931         * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
3932         * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
3933         OFFSETOF_EXPR.
3934         (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
3935         functions.
3936         * error.c (dump_expr): Handle OFFSETOF_EXPR.
3937
3938 2007-10-26  Jason Merrill  <jason@redhat.com>
3939
3940         PR c++/24791
3941         * pt.c (get_template_info): New fn.
3942         (template_class_depth): Use it.
3943         (push_template_decl_real): Check that the template args of the
3944         definition match the args of the previous declaration.
3945
3946 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
3947
3948         PR c++/31988
3949         * decl2.c (coerce_new_type): Do not allow a default argument for
3950         the first parameter.
3951
3952 2007-10-26  Douglas Gregor  <doug.gregor@gmail.com>
3953
3954         PR c++/33839
3955         * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
3956         don't see the leading '('. Only lookup names if we get an
3957         IDENTIFIER_NODE.
3958
3959 2007-10-26  Jakub Jelinek  <jakub@redhat.com>
3960
3961         PR c++/33744
3962         * parser.c (cp_parser_parenthesized_expression_list): Set
3963         greater_than_is_operator_p to true in between the parens.
3964
3965 2007-10-26  Paolo Carlini  <pcarlini@suse.de>
3966
3967         PR c++/31747
3968         * decl.c (grokdeclarator): In case of conflicting specifiers
3969         just return error_mark_node.
3970
3971 2007-10-26  Ollie Wild  <aaw@google.com>
3972
3973         * expr.c (cxx_expand_expr): Removed.
3974         * cp-tree.h (exx_expand_expr): Removed.
3975         * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
3976         with c_expand_expr.
3977
3978 2007-10-25  Paolo Carlini  <pcarlini@suse.de>
3979
3980         PR c++/33843
3981         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
3982
3983 2007-10-23  Jason Merrill  <jason@redhat.com>
3984
3985         PR c++/25950 (DR 391)
3986         * call.c (struct conversion): Remove check_copy_constructor_p.
3987         (reference_binding): Always bind a reference directly to a
3988         compatible class rvalue.  Pass down LOOKUP_NO_TEMP_BIND during
3989         temporary creation.
3990         (check_constructor_callable): Remove.
3991         (convert_like_real): Don't call it.
3992         (initialize_reference): Don't call check_constructor_callable.
3993         (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
3994         LOOKUP_CONSTRUCTOR_CALLABLE.  Don't require a temporary for base
3995         conversions if LOOKUP_NO_TEMP_BIND.
3996         (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
3997         (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
3998         second conversion.
3999         * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
4000
4001 2007-10-22  Jakub Jelinek  <jakub@redhat.com>
4002
4003         PR c++/33372
4004         * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
4005         before checking if its type is integral.
4006
4007 2007-10-22  Jason Merrill  <jason@redhat.com>
4008
4009         PR c++/33620
4010         * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
4011         * pt.c (apply_late_template_attributes): Splice out dependent
4012         attributes from DECL_ATTRIBUTES.
4013
4014         * decl.c (cxx_maybe_build_cleanup): Use build_address.
4015
4016 2007-10-17  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
4017
4018         * typeck.c (build_binary_op) : Use appropriate warning option
4019         instead of unnamed warning.
4020
4021 2007-10-16  Paolo Carlini  <pcarlini@suse.de>
4022
4023         PR c++/31446
4024         * pt.c (current_template_args): Do not change TREE_LIST elements
4025         with a TREE_VALUE of error_mark_node.
4026
4027 2007-10-16  Mark Mitchell  <mark@codesourcery.com>
4028
4029         * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
4030         * decl.c (start_decl): Tidy.
4031         (start_decl_1): Call cp_apply_type_quals_to_decl after completing
4032         the type.
4033         (grokdeclarator): Clarify comment.
4034
4035 2007-10-14  Andrew Pinski  <pinskia@gmail.com>
4036
4037         PR c++/30303
4038         * decl.c (grokfndecl): Return NULL after the "definition of
4039         implicitly-declared" error happened.
4040
4041 2007-10-12  Simon Martin  <simartin@users.sourceforge.net>
4042
4043         PR c++/26698
4044         * call.c (build_user_type_conversion_1): Do not consider conversion
4045         functions to convert a (possibly cv-qualified) object to the (possibly
4046         cv-qualified) same object type (or a reference to it), to a (possibly
4047         cv-qualified) base class of that type (or a reference to it).
4048
4049 2007-10-12  Paolo Carlini  <pcarlini@suse.de>
4050
4051         * pt.c (tsubst): Use template_parm_level_and_index.
4052
4053 2007-10-12  Jakub Jelinek  <jakub@redhat.com>
4054
4055         PR c++/32121
4056         * parser.c (cp_parser_compound_statement): Handle label-declarations
4057         at the beginning of the compound statement.
4058         (cp_parser_block_declaration): Issue diagnostics about __label__
4059         not at the beginning of a block.
4060
4061 2007-10-11  Paolo Carlini  <pcarlini@suse.de>
4062
4063         PR c++/33461
4064         * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
4065         to convert_template_argument.
4066         (coerce_template_parms): Return error_mark_node after fixed-length
4067         error.
4068         (tsubst_decl): Check for error_mark_node the return value of the
4069         first tsubst in 'case VAR_DECL'.
4070
4071 2007-10-08  Ollie Wild  <aaw@google.com>
4072
4073         * typeck2.c (digest_init): Call cplus_expand_constant after
4074         convert_for_initialization.
4075         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4076         * expr.c (cplus_expand_constant): Updated function description.
4077
4078 2007-10-04  Jason Merrill  <jason@redhat.com>
4079
4080         PR c++/20416
4081         * call.c (initialize_reference): Handle local static reference
4082         temps properly.
4083
4084 2007-10-03  Jason Merrill  <jason@redhat.com>
4085
4086         PR c++/32470
4087         * name-lookup.c (push_namespace_with_attrs): Fold back into...
4088         (push_namespace): Here.
4089         (handle_namespace_attrs): New fn for the attr code.
4090         (leave_scope): Don't pop_visibility.
4091         * name-lookup.h (struct cp_binding_level): Remove has_visibility.
4092         * parser.c (cp_parser_namespace_definition): Call
4093         handle_namespace_attrs and pop_visibility as appropriate.
4094
4095         PR c++/11756
4096         * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
4097
4098 2007-10-03  Alexandre Oliva  <aoliva@redhat.com>
4099
4100         * decl.c (duplicate_decls): Preserve linkage flags for mere
4101         redeclarations of gnu_inline definitions.
4102
4103 2007-10-03  Jason Merrill  <jason@redhat.com>
4104
4105         PR c++/15764
4106         * decl.c (wrap_cleanups_r): New fn.
4107         (wrap_temporary_cleanups): New fn.
4108         (initialize_local_var): Call it.
4109
4110 2007-09-29  Jason Merrill  <jason@redhat.com>
4111
4112         PR c++/33094
4113         * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
4114         constant to not have DECL_EXTERNAL if it's file-local.
4115
4116 2007-09-28  Ollie Wild  <aaw@google.com>
4117
4118         Revert
4119         2007-09-27  Ollie Wild  <aaw@google.com>
4120
4121         * typeck2.c (digest_init): Call cplus_expand_constant after
4122         convert_for_initialization.
4123         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4124         * expr.c (cplus_expand_constant): Updated function description.
4125
4126 2007-09-28  Jason Merrill  <jason@redhat.com>
4127
4128         PR c++/10179
4129         * class.c (layout_empty_base): Take rli parameter, update
4130         rli->record_align if empty base has user-specified alignment.
4131         (build_base_field): Pass rli to it.
4132
4133 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
4134
4135         PR c++/33213
4136         * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
4137
4138 2007-09-28  Paolo Carlini  <pcarlini@suse.de>
4139
4140         PR c++/33118
4141         * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
4142         (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
4143         (dump_parameters): Just call dump_type for argument packs too.
4144
4145 2007-09-28  Jakub Jelinek  <jakub@redhat.com>
4146
4147         PR c++/31434
4148         * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
4149         qualification by creating qualified PACK_EXPANSION_PATTERN and
4150         then calling make_pack_expansion on it.
4151
4152 2007-09-27  Ollie Wild  <aaw@google.com>
4153
4154         * typeck2.c (digest_init): Call cplus_expand_constant after
4155         convert_for_initialization.
4156         * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
4157         * expr.c (cplus_expand_constant): Updated function description.
4158
4159 2007-09-27  Jason Merrill  <jason@redhat.com>
4160
4161         PR c++/33571
4162         * decl2.c (is_late_template_attribute): Don't crash on unknown
4163         attribute.
4164
4165 2007-09-27  Paolo Carlini  <pcarlini@suse.de>
4166
4167         PR c++/33493
4168         * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
4169         * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
4170         spaces in the formatting.
4171         * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
4172
4173 2007-09-27  Jakub Jelinek  <jakub@redhat.com>
4174
4175         * error.c (cxx_print_error_function): Add third argument, pass
4176         it over to lhd_print_error_function.
4177         (cp_print_error_function): If diagnostic->abstract_origin, print
4178         virtual backtrace.
4179         * cp-tree.h (struct diagnostic_info): New forward decl.
4180         (cxx_print_error_function): Add third argument.
4181
4182 2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
4183
4184         PR c++/33207
4185         * name-lookup.c (pushtag): Do not create an implicit typedef before
4186         the associated type declaration is known to be valid.
4187
4188 2007-09-25  Jakub Jelinek  <jakub@redhat.com>
4189
4190         * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
4191         rather than pointers.
4192
4193 2007-09-24  Danny Smith  <dannysmith@user.sourceforge.net>
4194
4195         PR c++/14688
4196          * search.c (check_final_overrider): Fail if
4197         targetm.comp_type_attributes returns 0.
4198
4199 2007-09-24  Jason Merrill  <jason@redhat.com>
4200
4201         PR c++/33239
4202         * pt.c (resolve_typename_type): Don't look things up in the original
4203         template if it would mean losing template arguments.
4204
4205 2007-09-24  Jakub Jelinek  <jakub@redhat.com>
4206
4207         PR c++/33506
4208         * cp-tree.h (cxx_type_hash_eq): New prototype.
4209         * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
4210         * tree.c (cxx_type_hash_eq): New function.
4211
4212 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
4213
4214         PR c++/33185
4215         * tree.c (cp_build_qualified_type_real): Build a canonical
4216         ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
4217
4218 2007-09-24  Douglas Gregor  <doug.gregor@gmail.com>
4219
4220         PR c++/33112
4221         PR c++/33185
4222         * tree.c (cplus_array_compare): Compare pointers, not types.
4223         (build_cplus_array_type_1): Store new array type into the hash
4224         table before building the canonical type; build the canonical type
4225         correctly.
4226         (cp_build_qualified_type_real): Put all of the array types with
4227         cv-qualified element types into the C++ array hash table, built as
4228         variants of the unqualified versions.
4229
4230 2007-09-23  Jason Merrill  <jason@redhat.com>
4231
4232         PR c++/16370
4233         * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
4234         for deprecation warnings.
4235
4236 2007-09-22  Jason Merrill  <jason@redhat.com>
4237
4238         PR c++/15269
4239         * call.c (build_over_call): Warn about deprecated virtuals.
4240
4241         PR c++/19407
4242         * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
4243         (MAYBE_TAGGED_TYPE_P): Remove.
4244         * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
4245         instead of calling is_late_template_attribute again.
4246         (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
4247         (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
4248         Don't crash on typedefs from non-template classes.
4249         * decl2.c (grokfield): Don't sorry about attrs on template parms.
4250         (is_late_template_attribute): All attributes applied to template
4251         parms or typename types are dependent.  Static.
4252         (splice_template_attributes): Pass decl through.
4253         (save_template_attributes): Likewise.
4254
4255 2007-09-20  Jakub Jelinek  <jakub@redhat.com>
4256
4257         PR c++/33496
4258         * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
4259         returned from tsubst_pack_expansion.
4260         (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
4261         (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
4262
4263 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
4264
4265         PR c++/33460
4266         * semantics.c (finish_id_expression): Use consistently
4267         context_for_name_lookup.
4268         * decl.c (fixup_anonymous_aggr): Fix error message for
4269         anonymous struct (vs union).
4270
4271 2007-09-19  Jason Merrill  <jason@redhat.com>
4272
4273         PR c++/7586
4274         * pt.c (tsubst): Handle typedefs by looking for the specialization.
4275         (retrieve_specialization): Only tagged types use
4276         DECL_TEMPLATE_INSTANTIATIONS.
4277         (instantiate_class_template): Push nested classes too.
4278         (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
4279         tagged types.
4280         * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
4281         * init.c (is_aggr_type): Remove redundant tests.
4282         * class.c (push_nested_class): Use CLASS_TYPE_P.
4283
4284 2007-09-20  Paolo Carlini  <pcarlini@suse.de>
4285
4286         PR c++/33459
4287         * init.c (build_zero_init): If, recursively, build_zero_init
4288         returns a NULL_TREE, do not append it to the VEC of constructors.
4289
4290 2007-09-18  Jason Merrill  <jason@redhat.com>
4291
4292         PR c++/17743
4293         * pt.c (apply_late_template_attributes): Set processing_template_decl.
4294         (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
4295         ATTR_FLAG_TYPE_IN_PLACE.
4296         (tsubst): Do unqualified lookup to find typedefs from current class.
4297         [ARRAY_TYPE]: Propagate alignment info.
4298         * decl2.c (is_late_template_attribute): Only defer handling of
4299         attribute aligned if the expression is dependent.
4300         (save_template_attributes): If we're deferring any attributes,
4301         make this a naming typedef.
4302
4303 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4304
4305         PR c++/33462 (again)
4306         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
4307         va_arg instead of __builtin_va_arg.
4308
4309 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4310
4311         PR c++/33462
4312         * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
4313         (pp_cxx_primary_expression): Use it.
4314         * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
4315         * error.c (dump_expr): Use it.
4316
4317 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4318
4319         PR c++/33463
4320         * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
4321         out case TYPEID_EXPR to...
4322         (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
4323         and pp_cxx_right_paren.
4324         * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
4325         * error.c (dump_expr): Use it.
4326
4327 2007-09-18  Paolo Carlini  <pcarlini@suse.de>
4328
4329         PR c++/33464
4330         * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
4331         (pp_cxx_primary_expression): Use it.
4332         * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
4333         * error.c (dump_expr): Use it.
4334
4335 2007-09-16  Paolo Carlini  <pcarlini@suse.de>
4336
4337         PR c++/33124
4338         * init.c (build_new): Remove warning for zero-element
4339         allocations.
4340
4341 2007-09-16  Nathan Sidwell  <nathan@codesourcery.com>
4342
4343         PR c++/32756
4344         * call.c (maybe_handle_implicit_object): Set this_p, clear
4345         rvaluedness_matches_p.
4346         (compare_ics): Do not compare rvaluedness matching when one of the
4347         operands is an implicit object.
4348
4349 2007-09-14  Jason Merrill  <jason@redhat.com>
4350
4351         PR c++/17743, c++/19163
4352         * decl2.c (is_late_template_attribute): New fn.
4353         (splice_template_attributes, save_template_attributes): New fns.
4354         (cplus_decl_attributes): Call save_template_attributes.
4355         * pt.c (apply_late_template_attributes): New fn.
4356         (instantiate_class_template, tsubst_decl): Use it.
4357         * cp-tree.h: Declare is_late_template_attribute.
4358
4359 2007-09-13  Tom Tromey  <tromey@redhat.com>
4360
4361         * parser.c (cp_lexer_new_main): Don't use
4362         c_lex_return_raw_strings.
4363         (cp_lexer_get_preprocessor_token): Update.  Add special case when
4364         lexer is NULL.
4365
4366 2007-09-11  Jan Hubicka <jh@suse.cz>
4367
4368         * method.c (use_thunk): Use tree_rest_of_compilation
4369         * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
4370         (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
4371         * cp-tree.h (expand_body): Kill.
4372         (emit_associated_thunks): Declare.
4373         * semantics.c (emit_associated_thunks): Export.
4374         (expand_body): Kill.
4375
4376 2007-09-09  David Daney  <ddaney@avtrex.com>
4377
4378         PR c++/33324
4379         * init.c (build_new_1):  Use POINTER_PLUS_EXPR instead of MINUS_EXPR
4380         to calculate cookie_ptr.
4381
4382 2007-09-08  Jason Merrill  <jason@redhat.com>
4383
4384         PR c++/33342
4385         * pt.c (most_specialized_class): Set processing_template_decl
4386         while tsubsting partial spec args.
4387
4388 2007-09-06  Jason Merrill  <jason@redhat.com>
4389
4390         * decl2.c (get_guard): Copy visibility from the guarded variable.
4391
4392 2007-09-06  Jan Hubicka  <jh@suse.cz>
4393
4394         * semantics.c (expand_body): Do not mark arguments of clones used.
4395
4396 2007-09-06  Paolo Carlini  <pcarlini@suse.de>
4397
4398         PR c++/32674
4399         * decl.c (cp_finish_decl): When processing_template_decl,
4400         deal correctly with init as TREE_LIST.
4401
4402 2007-09-06  Tom Tromey  <tromey@redhat.com>
4403
4404         * decl.c (finish_function): Put return's location on line zero of
4405         file.
4406
4407 2007-09-05  Jason Merrill  <jason@redhat.com>
4408
4409         PR c++/15745
4410         * except.c (prepare_eh_type): Use type_decays_to.
4411
4412         PR c++/15097
4413         * init.c (build_delete): Use build_headof to get the address of the
4414         complete object if we aren't using the deleting destructor.
4415         * rtti.c (build_headof): No longer static.
4416         * cp-tree.h: Declare it.
4417
4418 2007-09-06  Jakub Jelinek  <jakub@redhat.com>
4419
4420         * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
4421         decl if a prototype for XX is provided with throw().
4422
4423         PR c++/33289
4424         * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
4425         on __*_chk non-__builtin_* decls.
4426
4427 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
4428
4429         PR c++/30302
4430         * semantics.c (finish_id_expression): Use context_for_name_lookup
4431         insted of DECL_CONTEXT, to see through anonymous structs and unions.
4432         * class.c (finish_struct_anon): Deal correctly with anonymous
4433         structs (vs unions, as GNU extension) in error messages.
4434
4435 2007-09-05  Jan Hubicka  <jh@suse.cz>
4436
4437         * sematics.c (expand_body): Remove unnecesary import_export_decl
4438         call, DECL_EXTERNAL checks and current_function_decl saving.
4439
4440 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
4441
4442         PR c++/29731 (again)
4443         * parser.c (cp_parser_primary_expression): Return error_mark_node
4444         when a statement-expression is found in a template-argument list.
4445
4446 2007-09-04  Jason Merrill  <jason@redhat.com>
4447
4448         * except.c (initialize_handler_parm): Use
4449         fold_build_cleanup_point_expr.
4450
4451         PR c++/31419
4452         * call.c (reference_binding): Don't look for user-defined conversions
4453         to the same type.
4454
4455         PR c++/31411
4456         * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
4457         the MUST_NOT_THROW_EXPR.
4458
4459 2007-09-04  Richard Sandiford  <richard@codesourcery.com>
4460
4461         * decl.c (cp_finish_decl): Call determine_visibility before
4462         make_rtl_for_nonlocal_decl.
4463
4464 2007-09-04  Jason Merrill  <jason@redhat.com>
4465
4466         PR c++/14032
4467         * pt.c (most_specialized_class): Substitute outer template
4468         arguments into the arguments of a member template partial
4469         specialization.
4470         (strip_innermost_template_args): New fn.
4471
4472 2007-09-03  Daniel Jacobowitz  <dan@codesourcery.com>
4473
4474         * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
4475
4476 2007-09-03  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4477
4478         * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
4479         * decl.c (cp_make_fname_decl): Likewise,
4480         * parser.c (cp_parser_string_literal): Likewise,
4481         * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
4482         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4483         Likewise,
4484
4485 2007-09-02  Paolo Carlini  <pcarlini@suse.de>
4486
4487         PR c++/33208
4488         * typeck.c (build_unary_op): Fix error message for
4489         Boolean expression as operand to operator--.
4490
4491 2007-09-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4492
4493         * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
4494         * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
4495         Likewise.
4496
4497 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
4498
4499         PR c++/32597
4500         * init.c (build_default_init): Make extern.
4501         * cp-tree.h (build_default_init): Declare here.
4502         * pt.c (tsubst_expr): When the instantiation of the initializer of
4503         a variable results in an empty list, default-initialize the
4504         variable.
4505         (tsubst_copy_and_build): When the instantiation of the initializer
4506         in a new expression results in an empty initializer list,
4507         default-initialize it.
4508
4509 2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
4510
4511         * mangle.c (write_type): Change mangling of rvalue reference from
4512         `RR' to `O'.
4513
4514 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
4515
4516         * decl.c (duplicate_decls): Remove duplicated line.
4517
4518 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4519
4520         PR c++/33210
4521         * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
4522         BOUND_TEMPLATE_TEMPLATE_PARM.
4523
4524 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4525
4526         PR c++/32113
4527         * search.c (lookup_member): Check the name argument for
4528         error_mark_node.
4529
4530 2007-08-31  Paolo Carlini  <pcarlini@suse.de>
4531
4532         PR c++/33212
4533         * parser.c (cp_parser_trait_expr): Check rerurn value of
4534         cp_parser_type_id.
4535
4536 2007-08-30  Ollie Wild  <aaw@google.com>
4537
4538         * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
4539         convert_ptrmem for pointer to member conversions.
4540         (convert_to_pointer_force): Update cp_convert_to_pointer call.
4541         (ocp_convert): Update cp_convert_to_pointer call.
4542         * typeck.c (convert_ptrmem): Add conditional for null pointers to
4543         members.
4544         (build_static_cast_1): Check can_convert for conversions in either
4545         direction.
4546         (get_delta_difference_1): New function.
4547         (get_delta_difference): Refactor to call get_delta_difference_1.
4548
4549 2007-08-30  Jakub Jelinek  <jakub@redhat.com>
4550
4551         * decl.c (start_preparsed_function): Set
4552         DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
4553
4554 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
4555
4556         PR c++/33209
4557         * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
4558         BOUND_TEMPLATE_TEMPLATE_PARM.
4559
4560 2007-08-28  Jakub Jelinek  <jakub@redhat.com>
4561
4562         PR c++/32596
4563         PR c++/32400
4564         * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
4565         and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
4566
4567 2007-08-27  Jason Merrill  <jason@redhat.com>
4568
4569         PR c++/29000
4570         * pt.c (build_non_dependent_expr, type_dependent_expression_p):
4571         Look inside STMT_EXPR.
4572         * semantics.c (stmt_expr_value_expr): New fn.
4573         * cp-tree.h: Declare it.
4574
4575         PR c++/28558
4576         * decl.c (groktypename): Ignore attributes applied to class type.
4577
4578 2007-08-28  Richard Guenther  <rguenther@suse.de>
4579
4580         * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
4581
4582 2007-08-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
4583
4584         * error.c (dump_expr): Handle COMPLEX_CST.
4585         * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
4586         (pp_cxx_expression): Likewise.
4587
4588 2007-08-27  Alexandre Oliva  <aoliva@redhat.com>
4589
4590         * decl.c (GNU_INLINE_P): New.
4591         (duplicate_decls): Handle gnu_inline.  Merge attributes and
4592         some flags in overriding definitions.
4593         (redeclaration_error_message): Handle gnu_inline.
4594         (start_preparsed_function): Likewise.
4595
4596 2007-08-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4597
4598         * call.c (sufficient_parms_p): Constify.
4599         * class.c (same_signature_p): Likewise.
4600         * cp-gimplify.c (is_invisiref_parm,
4601         cxx_omp_privatize_by_reference): Likewise.
4602         * cp-objcp-common.c (has_c_linkage): Likewise.
4603         * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
4604         sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
4605         grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
4606         num_artificial_parms_for, comp_template_parms,
4607         template_parameter_pack_p, any_dependent_template_arguments_p,
4608         any_type_dependent_arguments_p, any_value_dependent_elements_p,
4609         repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
4610         zero_init_p, member_p, cp_lvalue_kind,
4611         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4612         varargs_function_p, is_dummy_object, special_function_kind,
4613         string_conv_p, type_unknown_p, comp_except_specs, compparms,
4614         comp_cv_qualification, is_bitfield_expr_with_lowered_type,
4615         unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
4616         cp_has_mutable_p, at_least_as_qualified_p,
4617         invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
4618         * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
4619         * except.c (nothrow_libfn_p): Likewise.
4620         * method.c (skip_artificial_parms_for, num_artificial_parms_for):
4621         Likewise.
4622         * pt.c (comp_template_parms, template_parameter_pack_p,
4623         any_type_dependent_arguments_p, any_value_dependent_elements_p,
4624         any_dependent_template_arguments_p): Likewise.
4625         * repo.c (repo_export_class_p): Likewise.
4626         * semantics.c (anon_aggr_type_p): Likewise.
4627         * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
4628         builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
4629         varargs_function_p, member_p, is_dummy_object, pod_type_p,
4630         zero_init_p, special_function_p): Likewise.
4631         * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
4632         comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
4633         compparms, invalid_nonstatic_memfn_p,
4634         is_bitfield_expr_with_lowered_type, unlowered_expr_type,
4635         string_conv_p, ptr_reasonably_similar, cp_type_readonly,
4636         cp_has_mutable_p, lvalue_or_else): Likewise.
4637
4638 2007-08-25  Paolo Bonzini  <bonzini@gnu.org>
4639
4640         * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
4641         * cp-objcp-common.c (cp_tree_size): Ditto.
4642         * tree.c (cp_walk_subtrees): Ditto
4643         * cp-tree.def (TINST_LEVEL): Go away.
4644         * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
4645         move together with other non-tree structs.
4646         (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
4647         (union lang_tree_node): Eliminate tinst_level field.
4648         (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
4649         (current_instantiation, outermost_tinst_level): Return
4650         a "struct tinst_level *".
4651
4652         * error.c (print_instantiation_partial_context): Change second
4653         parameter to a "struct tinst_level *".  Replace accessor macros
4654         with field access.
4655         (print_instantiation_full_context): Likewise.
4656         * lex.c (in_main_input_context): Likewise.
4657
4658         * pt.c (struct pending_templates): New.
4659         (pending_templates, last_pending_template): Use it as a type.
4660         (current_tinst_level): Change typo to "struct tinst_level *"
4661         (reopen_tinst_level): Accept "struct tinst_level *", return decl.
4662         (add_pending_template): Construct a "struct pending_template".
4663         Replace TINST_LEVEL accessor macros with field access.
4664         (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
4665         (pop_tinst_level): Likewise.
4666         (instantiate_pending_templates): Likewise.  Factor common code used
4667         when an instantiation has been done.
4668         (outermost_tinst_level): Replace tree_last with loop.
4669         (current_instantiation): Return a "struct tinst_level *".
4670
4671 2007-08-24  Ollie Wild  <aaw@google.com>
4672
4673         * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
4674         * name-lookup.h (cp_binding_level): Remove vtables member.
4675
4676 2007-08-24  Richard Guenther  <rguenther@suse.de>
4677
4678         * tree.c (cp_cannot_inline_tree_fn): Remove.
4679         * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
4680         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
4681         Remove define.
4682
4683 2007-08-24  Jakub Jelinek  <jakub@redhat.com>
4684
4685         PR c++/32567
4686         * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
4687         error_mark_node right away if build_expr_type_conversion
4688         returned it.
4689
4690         PR c++/32898
4691         * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
4692         is error_mark_node rather than NULL_TREE.
4693         * pt.c (check_explicit_specialization): Likewise.
4694
4695         PR c++/31941
4696         * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
4697         TARGET_VTABLE_USES_DESCRIPTORS targets properly.
4698
4699 2007-08-22  Jason Merrill  <jason@redhat.com>
4700
4701         PR c++/29365
4702         * pt.c (outermost_tinst_level): New function.
4703         * lex.c (in_main_input_context): New function.
4704         * cp-tree.h: Declare it.
4705         * decl2.c (constrain_class_visibility): Use it to avoid warning
4706         about uses of the anonymous namespace in the main input file.
4707
4708 2007-08-21  Jakub Jelinek  <jakub@redhat.com>
4709
4710         * init.c (build_new_1): Use get_target_expr instead of save_expr.
4711
4712 2007-08-20  Pawel Sikora  <pluto@pld-linux.org>
4713
4714         PR c++/7302
4715         * class.c (finish_struct_1): Warn when a class has virtual
4716         functions and accessible non-virtual destructor.
4717
4718 2007-08-20  Richard Guenther  <rguenther@suse.de>
4719
4720         PR c++/22369
4721         PR c++/22451
4722         * call.c (build_new_method_call): Convert initializer to
4723         the basetype.
4724         * init.c (build_aggr_init): Do not fiddle with types.
4725         (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
4726         * except.c (build_throw): Do not drop qualifiers for the
4727         pointer type.
4728         * typeck.c (get_member_function_from_ptrfunc): Do not
4729         fiddle with types, instead convert.
4730         (build_ptrmemfunc1): Convert to the target type for
4731         initialization.
4732         (gfc_trans_allocate): Convert result to target type.
4733         * cp-objcp-common.c (cxx_get_alias_set): Pointers to
4734         pointer-to-member structures shall have alias set zero as well.
4735
4736 2007-08-20  Richard Guenther  <rguenther@suse.de>
4737
4738         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
4739         Remove.
4740         * cp-tree.h (cp_auto_var_in_fn_p): Remove.
4741         (nonstatic_local_decl_p): Likewise.
4742         * tree.c (cp_auto_var_in_fn_p): Remove.
4743         * decl.c (nonstatic_local_decl_p): Remove.
4744
4745 2007-08-20  Richard Guenther  <rguenther@suse.de>
4746
4747         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
4748         Remove define.
4749         * tree.h (cp_walk_tree): New define to walk_tree_1 with
4750         cp_walk_subtrees lh parameter.
4751         (cp_walk_tree_without_duplicates): New define to
4752         walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
4753         * tree.c (count_trees): Call
4754         cp_walk_tree_without_duplicates.
4755         (verify_stmt_tree): Call cp_walk_tree.
4756         (break_out_target_exprs): Likewise.
4757         (WALK_SUBTREE): Likewise.
4758         * cp-gimplify.c (cp_genericize): Likewise.
4759         * cp-pt.c (find_parameter_packs_r): Likewise.
4760         (uses_parameter_packs): Likewise.
4761         (make_pack_expansion): Likewise.
4762         (check_for_bare_parameter_packs): Likewise.
4763         (for_each_template_parm): Likewise.
4764         * decl.c (check_default_argument): Call
4765         cp_walk_tree_without_duplicates.
4766         * except.c (build_throw): Likewise.
4767         * decl2.c (type_visibility): Likewise.
4768         * semantics.c (expand_or_defer_fn): Likewise.
4769         (finalize_nrv): Call cp_walk_tree.
4770
4771 2007-08-20  Jakub Jelinek  <jakub@redhat.com>
4772
4773         PR c++/33025
4774         * init.c (build_new_1): Rename placement_var variable to placement_expr.
4775         Initialize it with save_expr rather than get_temp_regvar.
4776
4777 2007-08-17  Andrew Pinski  <andrew_pinski@playstation.sony.com>
4778
4779         PR c++/28989
4780         * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
4781         lvalues.
4782
4783 2007-08-17  Ollie Wild  <aaw@google.com>
4784
4785         PR c++/31749
4786         * name-lookup.c (do_nonmember_using_decl): Shift implicit type
4787         declarations into appropriate slots for comparison.  Fix type
4788         comparison.
4789
4790 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
4791
4792         PR c++/32112
4793         * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
4794         * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
4795
4796 2007-08-17  Paolo Carlini  <pcarlini@suse.de>
4797
4798         PR c++/32870
4799         * parser.c (cp_parser_class_head): Improve error message.
4800
4801 2007-08-16  Seongbae Park  <seongbae.park@gmail.com>
4802
4803         * pt.c (instantiate_decl): Set input_location
4804         for the function end.
4805
4806 2007-08-16  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4807
4808         * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
4809         Constify.
4810         * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
4811         class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
4812         cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
4813         cxx_warn_unused_global_decl, cp_expr_size): Likewise.
4814         * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
4815         * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
4816         * typeck.c (cp_type_quals): Likewise.
4817         * typeck2.c (cxx_incomplete_type_diagnostic,
4818         cxx_incomplete_type_error): Likewise.
4819
4820 2007-08-16  Paolo Carlini  <pcarlini@suse.de>
4821
4822         PR c++/31132
4823         * pt.c (tsubst_friend_function): When check_classfn
4824         returns error_mark_node likewise return it.
4825
4826 2007-08-15  Jakub Jelinek  <jakub@redhat.com>
4827
4828         PR c++/32992
4829         * typeck.c (check_return_expr): Don't NRV optimize vars in
4830         anonymous unions.
4831         * decl.c (finish_function): Comment fix.
4832
4833 2007-08-15  Paolo Carlini  <pcarlini@suse.de>
4834
4835         PR c++/33035
4836         * pt.c (push_template_decl_real): Depending on TYPE_P
4837         use either TYPE_CONTEXT or DECL_CONTEXT.
4838
4839 2007-08-14  Mark Mitchell  <mark@codesourcery.com>
4840
4841         * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
4842         constructors and destructors return this.
4843
4844 2007-08-14  Paolo Carlini  <pcarlini@suse.de>
4845
4846         PR c++/27211
4847         * decl2.c (check_classfn): Return error_mark_node in case of error;
4848         in that case, do not call add_method.
4849         * decl.c (start_decl): Deal with check_classfn returning
4850         error_mark_node.
4851         (grokfndecl): Likewise.
4852         * pt.c (tsubst_friend_function): Likewise.
4853
4854 2007-08-14  Andrew Pinski  <pinskia@gmail.com>
4855
4856         PR c++/30428
4857         * typeck.c (build_binary_op): Disallow vector float types with
4858         BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
4859
4860 2007-08-11  Ian Lance Taylor  <iant@google.com>
4861
4862         * cp-objcp-common.c (cxx_get_alias_set): Change return type to
4863         alias_set_type.
4864         * cp-tree.h (cxx_get_alias_set): Update declaration.
4865
4866 2007-08-10  Ollie Wild  <aaw@google.com>
4867
4868         * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
4869         type lookups.
4870         (ambiguous_decl): Construct tree of ambiguous types.  Remove extaneous
4871         function parameter.
4872         (unqualified_namespace_lookup): Fix ambiguous_decl call.
4873         (lookup_using_namespace): Fix ambiguous_decl call.
4874         (qualified_lookup_using_namespace): Fix ambiguous_decl call.
4875
4876 2007-08-10  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4877
4878         * call.c (name_as_c_string): Use CONST_CAST.
4879         * decl.c (build_decl): Likewise.
4880         * parser.c (cp_parser_string_literal): Likewise.
4881
4882 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
4883
4884         PR c++/17763
4885         * error.c (dump_expr): Consistently use the *_cxx_*
4886         variants of the pretty-print functions.
4887
4888 2007-08-10  Paolo Carlini  <pcarlini@suse.de>
4889
4890         PR c++/22256
4891         * decl.c (check_special_function_return_type): Just error
4892         on return type specified for conversion operator.
4893
4894 2007-08-09  Daniel Berlin  <dberlin@dberlin.org>
4895
4896         * typeck2.c (readonly_error): Handle general expressions.
4897         * error.c (dump_expr): Handle POINTER_PLUS_EXPR
4898
4899 2007-08-06  Dan Hipschman  <dsh@google.com>
4900
4901         * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
4902         access function name.
4903
4904 2007-08-04  Alfred Minarik  <a.minarik@aon.at>
4905
4906         PR pch/13676
4907         * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
4908         * g++spec.c (lang_specific_driver): Check them.
4909
4910 2007-08-06  Paolo Carlini  <pcarlini@suse.de>
4911
4912         PR c++/19532
4913         * pt.c (inline_needs_template_parms): Fix comment; change return type
4914         to bool.
4915
4916 2007-08-05  Volker Reichelt  <v.reichelt@netcologne.de>
4917
4918         Revert:
4919         2007-03-26  Dirk Mueller  <dmueller@suse.de>
4920
4921         * parser.c (cp_parser_member_declaration): Pedwarn
4922         about stray semicolons after member declarations.
4923
4924 2007-08-02  Lee Millward  <lee.millward@gmail.com>
4925
4926         PR c++/30849
4927         PR c++/30850
4928         PR c++/30851
4929         * parser.c (cp_parser_asm_definition): Detect and discard asm
4930         statements with invalid inputs or outputs.
4931          (cp_parser_asm_operand_list): Return error mark node if any
4932          of the operands are invalid. Adjust documentation.
4933
4934 2007-08-02  Nick Clifton  <nickc@redhat.com>
4935
4936         * typeck.c: Change copyright header to refer to version 3 of the
4937         GNU General Public License and to point readers at the COPYING3
4938         file and the FSF's license web page.
4939         * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
4940         config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
4941         Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
4942         cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
4943         tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
4944         cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
4945         cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
4946         name-lookup.h, parser.c: Likewise.
4947
4948 2007-08-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4949
4950         PR middle-end/32668
4951         * call.c (magic_varargs_p): Honor the "type generic" attribute.
4952
4953 2007-07-30  Paolo Carlini  <pcarlini@suse.de>
4954
4955         PR c++/32108
4956         * semantics.c (finish_label_stmt): Reject the __label__
4957         extension outside function scopes.
4958
4959 2007-07-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4960
4961         * parser.c (eof_token): Un-constify.
4962         (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
4963         cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
4964         casts.
4965
4966 2007-07-28  Kazu Hirata  <kazu@codesourcery.com>
4967
4968         * pt.c, tree.c, typeck2.c: Fix comment typos.
4969
4970 2007-07-28  Simon Martin  <simartin@users.sourceforge.net>
4971             Mark Mitchell  <mark@codesourcery.com>
4972
4973         PR c++/30917
4974         * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
4975         hidden due to friend declarations in local classes.
4976
4977 2007-07-27  Douglas Gregor  <doug.gregor@gmail.com>
4978
4979         * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
4980         * cp-tree.def (DECLTYPE_TYPE): New.
4981         * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
4982         (dump_type_prefix): Ditto.
4983         (dump_type_suffix): Ditto.
4984         * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
4985         * mangle.c (write_type): Handle DECLTYPE_TYPE.
4986         * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
4987         types.
4988         (DECLTYPE_TYPE_EXPR): New.
4989         (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
4990         (finish_declared_type): Declare.
4991         * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
4992         DECLTYPE_TYPE nodes.
4993         (pp_cxx_type_id): Ditto.
4994         * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
4995         (tsubst): Substitute into a DECLTYPE_TYPE node.
4996         (tsubst_copy): Ditto.
4997         (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
4998         nodes.
4999         (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
5000         * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
5001         structural equality (because we can't hash the expressions).
5002         (finish_declared_type): New.
5003         * lex.c (reswords): Add "decltype" keyword.
5004         * parser.c cp_lexer_next_token_is_decl_specifier_keyword
5005         (cp_parser_postfix_expression): Add member_access_only_p to
5006         restrict postfix expression to member access expressions.
5007         (cp_parser_unary_expression): Update call to
5008         cp_parser_postfix_expression to reflect new parameter.
5009         (cp_parser_declared_type): New.
5010         (cp_parser_simple_type_specifier): Parse decltype types.
5011
5012 2007-07-27  Mark Mitchell  <mark@codesourcery.com>
5013
5014         PR c++/32346
5015         * call.c (convert_for_arg_passing): Only widen bitfields to their
5016         declared types if necessary.
5017
5018 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5019
5020         * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
5021         Constify.
5022
5023 2007-07-25  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
5024
5025         * decl.c (typename_hash, typename_compare): Constify.
5026         * mangle.c (hash_type, compare_type): Likewise.
5027         * pt.c (eq_local_specializations, hash_local_specialization):
5028         Likewise.
5029         * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
5030         list_hash): Likewise.
5031         * typeck2.c (pat_compare): Likewise.
5032
5033 2007-07-24  Nathan Sidwell  <nathan@codesourcery.com>
5034
5035         * method.c (implicitly_declare_fn): Increase alignment if member
5036         function pointer format requires it.
5037
5038 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
5039
5040         PR c++/29001
5041         * typeck.c (check_return_expr): Do not pass a null argument
5042         to null_ptr_cst_p.
5043
5044 2007-07-24  Paolo Carlini  <pcarlini@suse.de>
5045
5046         PR c++/32561
5047         * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
5048         only on VAR_DECL.
5049
5050 2007-07-22  Nathan Sidwell  <nathan@codesourcery.com>
5051
5052         PR c++/32839
5053         * typeck.c (convert_arguments): Only use default args if we have
5054         a function decl.
5055
5056         PR c++/30818
5057         * typeck.c (structural_comptypes): No need to check
5058         resolve_typename_type return value here.
5059         * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
5060         * pt.c (resolve_typename_type): Follow typename typedefs.  Return
5061         original type rather than error_mark_node in case of failure.
5062         * parser.c (cp_parser_nested_name_specifier_opt): Adjust
5063         resolve_typename_type result check.
5064         (cp_parser_direct_declarator, cp_parser_head,
5065         cp_parser_constructor_declarator_p): Likewise.
5066
5067 2007-07-12  Kazu Hirata  <kazu@codesourcery.com>
5068
5069         * pt.c (template_parms_variadic_p): Remove.
5070         * cp-tree.h: Remove the prototype for template_parms_variadic_p.
5071
5072 2007-07-12  Jakub Jelinek  <jakub@redhat.com>
5073
5074         PR c++/30854
5075         * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
5076         argument to dump_aggr_init_expr_args instead of false.
5077
5078 2007-07-11  Douglas Gregor  <doug.gregor@gmail.com>
5079
5080         * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
5081         canonical types; otherwise, fall back to structural type
5082         comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
5083         internal compiler error if the canonical types are wrong.
5084
5085 2007-07-11  Paolo Carlini  <pcarlini@suse.de>
5086
5087         PR c++/32560
5088         * parser.c (cp_parser_make_indirect_declarator): When the
5089         the code argument is ERROR_MARK return cp_error_declarator.
5090
5091 2007-07-09  Geoffrey Keating  <geoffk@apple.com>
5092
5093         PR 32617
5094         * decl.c (cxx_init_decl_processing): Don't set
5095         force_align_functions_log.
5096         (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
5097         * typeck.c (cxx_alignof_expr): When alignof is used on a plain
5098         FUNCTION_DECL, return its alignment.
5099
5100 2007-07-09  Richard Guenther  <rguenther@suse.de>
5101
5102         * decl.c (start_preparsed_function): Do not promote return type.
5103
5104 2007-07-08  Paolo Carlini  <pcarlini@suse.de>
5105
5106         PR c++/30535
5107         * pt.c (unify): Never pass error_mark_node to template_decl_level.
5108
5109 2007-07-07  Mark Mitchell  <mark@codesourcery.com>
5110
5111         PR c++/32232
5112         * pt.c (resolve_overloaded_unification): Robustify.  Return a
5113         bool, not an int.
5114         (type_unification_real): Adjust accordingly.
5115
5116 2007-07-06  Richard Guenther  <rguenther@suse.de>
5117
5118         * init.c (build_new_1): Use the correct pointer type.
5119         * typeck2.c (build_m_component_ref): Likewise.
5120
5121 2007-07-05  Mark Mitchell  <mark@codesourcery.com>
5122
5123         PR c++/32245
5124         * init.c (build_zero_init): Always build an initializer for
5125         non-static storage.
5126         * typeck2.c (build_functional_cast): Use build_zero_init.
5127
5128         PR c++/32251
5129         * init.c (build_new_1): Always pass the allocation function to
5130         build_op_delete_call.
5131         * call.c (build_op_delete_call): Handle operator delete with a
5132         variable-argument list.  Do not issue an error when no matching
5133         deallocation function is available for a new operator.
5134
5135         PR c++/31992
5136         * cp-tree.h (any_value_dependent_elements_p): Declare it.
5137         * decl.c (value_dependent_init_p): New function.
5138         (cp_finish_decl): Use it.
5139         * pt.c (value_dependent_expression_p): Use
5140         any_value_dependent_elements_p.
5141         * parser.c (cp_parser_primary_expression): Add comment about
5142         treating dependent qualified names as integral
5143         constant-expressions.
5144
5145 2007-07-04  Douglas Gregor  <doug.gregor@gmail.com>
5146
5147         * decl.c (build_ptrmemfunc_type): Always use structural equality
5148         tests when comparing pointer-to-member-function types, because the
5149         handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
5150         types.
5151
5152 2007-07-03  Mark Mitchell  <mark@codesourcery.com>
5153
5154         * init.c (build_new): Tweak comment.
5155
5156 2007-06-29  Dave Brolley  <brolley@redhat.com>
5157
5158         PR c++/31743
5159         * parser.c (cp_parser_new_type_id): Don't reduce a named array
5160         type to its base type and number of elements here.
5161         * init.c (build_new): Call complete_type_or_else to ensure that the
5162         type is complete and to issue a diagnostic if it is not.
5163         (build_new_1): Don't call complete_type_or_else here.
5164
5165 2007-07-03  Richard Guenther  <rguenther@suse.de>
5166
5167         PR c++/32609
5168         * class.c (fixed_type_or_null): Re-lookup the hashtable slot
5169         after recursing.
5170
5171 2007-07-02  Simon Baldwin  <simonb@google.com>
5172
5173         * parser.c (cp_parser_elaborated_type_specifier): Added a warning
5174         for inner-style nested forward declarations that don't declare
5175         anything useful.
5176
5177 2007-07-02  Jakub Jelinek  <jakub@redhat.com>
5178
5179         PR c++/31748
5180         * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
5181         DECL_P in not a variable and appears more than once error messages.
5182
5183 2007-07-01  Ollie Wild  <aaw@google.com>
5184
5185         * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
5186         (select_decl): Remove function.
5187         (unqualified_namespace_lookup): Populate binding by calling
5188         ambiguous_decl.  Remove select_decl call.
5189         (lookup_qualified_name): Remove select_decl call.
5190         * decl.c (lookup_and_check_tag): Check for ambiguous references.
5191         * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
5192         generation when name lookup is ambiguous.
5193
5194 2007-06-29  Douglas Gregor  <doug.gregor@gmail.com>
5195
5196         PR c++/31724
5197         * init.c (build_new_1): Use structural equality on the copy of the
5198         array type.
5199
5200 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
5201
5202         * decl2.c (determine_visibility): Implement
5203         flag_visibility_ms_compat effect on type info.
5204         * decl.c (cxx_init_decl_processing): Implement
5205         global effect of flag_visibility_ms_compat.
5206
5207 2007-06-28  Geoffrey Keating  <geoffk@apple.com>
5208
5209         * decl2.c (start_objects): Mark constructor-running function
5210         as artificial.
5211
5212 2007-06-26  Simon Martin  <simartin@users.sourceforge.net>
5213
5214         PR c++/32111
5215         * decl.c (grokdeclarator): Reset friendp for member functions declared
5216         friend of their own class.
5217
5218 2007-06-23  Mark Mitchell  <mark@codesourcery.com>
5219
5220         * decl2.c (determine_visibility): Don't look for dllexport here.
5221         (determine_visibility_from_class): Tidy.
5222
5223 2007-06-18  Simon Baldwin <simonb@google.com>
5224
5225         PR c++/31923
5226         * parser.c (cp_parser_single_declaration): Added check for storage
5227         class other than sc_none in parsed declaration, and a flag to indicate
5228         if the call is part of an explicit template specialization parse.
5229         * (cp_parser_explicit_specialization): Specialization check flag added
5230         to call to cp_parser_single_declaration(), set true.
5231         * (cp_parser_template_declaration_after_export): Specialization check
5232         flag added to call to cp_parser_single_declaration(), set false.
5233         * pt.c (check_explicit_specialization): Added code to copy visiblity
5234         and linkage from the templated function to the explicit specialization.
5235
5236 2007-06-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5237
5238         * typeck.c (build_binary_op): For templates build the
5239         expression in pieces to avoid the assert in build2_stat.
5240         (get_member_function_from_ptrfunc):
5241         Change over to using POINTER_PLUS_EXPR and convert
5242         the second operand to sizetype.
5243         * typeck2.c (build_m_component_ref):  Likewise.
5244         * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
5245         instead of PLUS_EXPR for pointers.
5246         (build_new_1): Likewise.
5247         (build_vec_delete_1): Likewise.
5248         (build_vec_delete): Likewise.
5249         * class.c (build_base_path): Likewise.
5250         (build_base_path): Likewise.
5251         (convert_to_base_statically): Likewise.
5252         (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
5253         (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
5254         instead of PLUS_EXPR.
5255         (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
5256         instead of PLUS_EXPR for pointers.
5257         * call.c (build_special_member_call): Likewise.
5258         * rtti.c (build_headof): Likewise.
5259         Use sizetype instead of ptrdiff_type_node.
5260         (tinfo_base_init): Create a POINTER_PLUS_EXPR
5261         instead of PLUS_EXPR for pointers.
5262         * except.c (expand_start_catch_block):  Do a
5263         NEGATIVE and then a POINTER_PLUS_EXPR instead
5264         of a MINUS_EXPR.
5265         * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
5266         PLUS_EXPR on pointer types over to use
5267         POINTER_PLUS_EXPR and remove the conversion
5268         to the pointer types.
5269         * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
5270         adding to a pointer type. Use size_int instead of
5271         ssize_int. Convert the index to sizetype before
5272         adding it to the pointer.
5273
5274 2007-06-15  Mark Mitchell  <mark@codesourcery.com>
5275
5276         * cp-tree.h (DECL_VAR_MARKED_P): Remove.
5277         (DECL_ANON_UNION_VAR_P): New macro.
5278         * class.c (fixed_type_or_null): Tidy.  Use a hash table, rather
5279         than DECL_VAR_MARKED_P, to keep track of which variables we have
5280         seen.
5281         * decl.c (redeclaration_error_message): Complain about redeclaring
5282         anonymous union members at namespace scope.
5283         * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
5284
5285 2007-06-14  Geoff Keating  <geoffk@apple.com>
5286
5287         * decl2.c (determine_visibility): Ensure that functions with
5288         hidden types as parameters are hidden.
5289
5290         PR 31093
5291         * decl2.c (determine_visibility): Remove duplicate code for
5292         handling type info.
5293
5294 2007-06-12  Ian Lance Taylor  <iant@google.com>
5295
5296         PR libstdc++/29286
5297         * init.c (avoid_placement_new_aliasing): New static function.
5298         (build_new_1): Call it.
5299
5300 2007-06-11  Rafael Ávila de Espíndola  <espindola@google.com>
5301
5302         * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
5303         (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
5304
5305 2007-06-08  Jakub Jelinek  <jakub@redhat.com>
5306
5307         PR c++/32177
5308         * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
5309         on init, the non-decl cond operand and increment value.
5310
5311 2007-06-07  Simon Martin  <simartin@users.sourceforge.net>
5312
5313         PR c++/30759
5314         * decl.c (check_initializer): Report an error when a brace enclosed
5315         initializer is used for a non-aggregate type in C++98.
5316         (redeclaration_error_message): Rewrote flag_cpp0x in terms of
5317         cxx_dialect.
5318         (grokdeclarator): Likewise.
5319         (move_fn_p): Likewise.
5320         * typeck.c (check_return_expr): Likewise.
5321         * call.c (reference_binding): Likewise.
5322         * error.c (cp_cpp_error): Likewise.
5323         * pt.c (check_default_tmpl_args): Likewise.
5324         (tsubst): Likewise.
5325         * lex.c (init_reswords): Likewise.
5326         * parser.c (p_parser_primary_expression): Likewise.
5327         (TOKEN_PRECEDENCE): Likewise.
5328         (cp_parser_init_declarator): Likewise.
5329         (cp_parser_ptr_operator): Likewise.
5330         (cp_parser_parameter_declaration): Likewise.
5331         (cp_parser_enclosed_template_argument_list): Likewise.
5332         (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
5333         (cp_parser_next_token_ends_template_argument_p): Likewise.
5334
5335 2007-06-04  Simon Baldwin  <simonb@google.com>
5336
5337         * decl.c (grokdeclarator): Readability change.  Moved case labels
5338         into direct switch statement scope.
5339
5340 2007-06-04  Paolo Carlini  <pcarlini@suse.de>
5341
5342         * call.c (convert_like_real): Remove pointless code.
5343
5344 2007-05-31  Mark Mitchell  <mark@codesourcery.com>
5345
5346         * decl.c (get_atexit_fn_ptr_type): New function.
5347         (get_atexit_node): Use it.
5348         (start_cleanup_fn): Likewise.
5349         (register_dtor_fn): Use the object's destructor, instead of a
5350         separate cleanup function, where possible.
5351         * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
5352         (atexit_fn_ptr_type_node): New macro.
5353         * decl2.c (build_cleanup): Use build_address.
5354
5355 2007-05-31  Daniel Berlin  <dberlin@dberlin.org>
5356
5357         * typeck.c (build_binary_op): Include types in error.
5358
5359 2007-05-31  Jakub Jelinek  <jakub@redhat.com>
5360
5361         PR c++/31806
5362         * decl.c (cp_finish_decl): Also clear was_readonly if a static var
5363         needs runtime initialization.
5364
5365 2007-05-31  Paolo Carlini  <pcarlini@suse.de>
5366
5367         PR c++/32158
5368         * semantics.c (finish_trait_expr): Complete the types.
5369
5370 2007-05-30  Russell Yanofsky <russ@yanofsky.org>
5371              Douglas Gregor <doug.gregor@gmail.com>
5372              Pedro Lamarao <pedro.lamarao@mndfck.org>
5373              Howard Hinnant <howard.hinnant@gmail.com>
5374
5375         PR c++/7412
5376         PR c++/29939
5377         * typeck.c (comptypes): Don't consider rvalue and lvalue
5378         reference types to be equivalent.
5379         (check_return_expr): Move from certain lvalues when returning
5380         them.
5381         * decl.c (grokdeclarator): Implement reference collapsing.
5382         (copy_fn_p): Don't consider constructors taking rvalue references
5383         to be copy constructors.
5384         (move_fn_p): New.
5385         * call.c (conversion): New "rvaluedness_matches_p" member.
5386         (convert_class_to_reference): Require reference type as first
5387         parameter instead of base type.
5388         (reference_binding): Add logic to handle rvalue references.
5389         (implicit_conversion): Update inaccurate comment.
5390         (convert_like_real): Disable creation of temporaries that are
5391         impossible to initialize for types with move constructors.
5392         (build_over_call): Elide move constructors when possible.
5393         (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
5394         (maybe_handle_ref_bind): Return conversion instead of type node.
5395         (compare_ics): Add logic to use "rvaluedness_matches_p" values to
5396         determine preferred conversion sequences.
5397         * cp-tree.h (TYPE_REF_IS_RVALUE): New.
5398         (LOOKUP_PREFER_RVALUE): New.
5399         (DECL_MOVE_CONSTRUCTOR_P): New.
5400         (struct cp_declarator): Add "reference" member for reference
5401         types, with new "rvalue_ref" flag.
5402         (cp_build_reference_type): Declare.
5403         (move_fn_p): Declare.
5404         * error.c (dump_type_prefix): Format rvalue reference types
5405         correctly in error messages.
5406         * except.c (build_throw): Move from certain lvalues when
5407         throwing.
5408         * mangle.c (write_type): Mangle rvalue references differently
5409         than regular references.
5410         * parser.c (make_reference_declarator): Add boolean parameter for
5411         rvalue references.
5412         (cp_parser_make_indirect_declarator): New.
5413         (cp_parser_new_declarator_opt): Call
5414         cp_parser_make_indirect_declarator.
5415         (cp_parser_conversion_declarator_opt): Ditto.
5416         (cp_parser_declarator): Ditto.
5417         (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
5418         declarators.
5419         * pt.c (tsubst): Implement reference collapsing.
5420         (maybe_adjust_types_for_deduction): Implement special template
5421         parameter deduction rule for rvalue references.
5422         (type_unification_real): Update calls to
5423         maybe_adjust_types_for_deduction.
5424         (try_one_overload): Ditto.
5425         (unify_pack_expansion): Ditto.
5426         * tree.c (lvalue_p_1): Handle rvalue reference types.
5427         (cp_build_reference_type): New.
5428
5429 2007-05-30  Jakub Jelinek  <jakub@redhat.com>
5430
5431         PR c++/31809
5432         * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
5433         variables that need runtime initialization.
5434
5435 2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>
5436
5437         PR c++/31339
5438         * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
5439         case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
5440         case POSTDECREMENT_EXPR>): Return the error_mark_node
5441         if either the real or imaginary parts would an
5442         error_mark_node.
5443
5444 2007-05-25  Simon Martin  <simartin@users.sourceforge.net>
5445             Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5446
5447         PR c++/31745
5448         * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
5449         token is a closing brace, false if there are no tokens left.
5450         (cp_parser_namespace_alias_definition): Only consume the next token if
5451         it is a closing brace.
5452
5453         * parser.c (cp_parser_class_specifier): Likewise.
5454
5455 2007-05-25  H.J. Lu  <hongjiu.lu@intel.com>
5456
5457         * semantics.c (finish_member_declaration): Fix a typo in the
5458         last checkin.
5459
5460 2007-05-25  Douglas Gregor <doug.gregor@gmail.com>
5461
5462         PR c++/31431
5463         PR c++/31432
5464         PR c++/31434
5465         PR c++/31435
5466         PR c++/31437
5467         PR c++/31438
5468         PR c++/31442
5469         PR c++/31443
5470         PR c++/31444
5471         PR c++/31445
5472         * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
5473         * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
5474         * pt.c (check_for_bare_parameter_packs): Return bool indicated
5475         whether everything was okay. Fix indentation.
5476         (push_template_decl_real): Check for bare parameter packs in
5477         function parameters; where errors occur, mark the parameter types
5478         with ERROR_MARK_NODEs to avert ICEs.
5479         (coerce_template_parameter_pack): New.
5480         (coerce_template_parms): Moved parameter pack coercion into
5481         coerce_template_parameter_pack, and permit it anywhere in the
5482         template parameter list (not just at the end). Parameter and
5483         argument indices can vary (somewhat) separately now, so add
5484         PARM_IDX and ARG_IDX.
5485         (fn_type_unification): Don't set an argument pack as incomplete if
5486         no argument pack was deduced.
5487         (type_unification_real): If a type parameter is a parameter pack
5488         and has not otherwise been deduced, it will be deduced to an empty
5489         parameter pack.
5490         (more_specialized_fn): Use the actual lengths of the argument
5491         lists when comparing against expansions.
5492         * semantics.c (finish_member_declaration): If a field's type has
5493         bare parameter packs, error and set its type to ERROR_MARK_NODE.
5494
5495 2007-05-24  Danny Smith  <dannysmith@users.sourceforge.net>
5496
5497         PR target/27067
5498         * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
5499
5500 2007-05-22  Ollie Wild  <aaw@google.com>
5501
5502         * name-lookup.c (ambiguous_decl): Adds check for hidden types.
5503         (unqualified_namespace_lookup): Adds check for hidden types.
5504
5505 2007-05-22  Ollie Wild  <aaw@google.com>
5506
5507         * decl.c (duplicate_decls): Verify namespace names are unique.
5508
5509 2007-05-21  Mark Mitchell  <mark@codesourcery.com>
5510
5511         * decl.c (cxx_maybe_build_cleanup): Handle
5512         __attribute__((cleanup)).
5513
5514 2007-05-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5515
5516         * cvt.c (cp_convert_and_check): Don't check warnings if the
5517         conversion failed.
5518
5519 2007-05-18  Geoffrey Keating  <geoffk@apple.com>
5520
5521         * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
5522
5523 2007-05-14  Paolo Carlini  <pcarlini@suse.de>
5524
5525         PR c++/29928
5526         * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
5527         type only if is a class type (5.2.8/4).
5528
5529 2007-05-14  Rafael Ávila de Espíndola  <espindola@google.com>
5530
5531         * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
5532         * decl.c (grokdeclarator): Use unsigned_type_for instead of
5533         c_common_unsigned_type.
5534
5535 2007-05-11  Silvius Rus  <rus@google.com>
5536
5537         * typeck.c (build_indirect_ref): Add call to
5538         strict_aliasing_warning.
5539         (build_reinterpret_cast_1): Condition call to
5540         strict_aliasing_warning.
5541
5542 2007-05-11  Jan Hubicka  <jh@suse.cz>
5543
5544         * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
5545         * decl2.c (start_objects): ctors and dtors are no longer public.
5546         (cp_write_global_declarations): Do not call c_build_cdtor_fns.
5547
5548 2007-05-07  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5549
5550         * typeck.c (build_unary_op): Remove code that used to
5551         handle non lvalue increments/decrements.
5552
5553 2007-05-07  Mike Stump  <mrs@apple.com>
5554
5555         * parser.c (check_empty_body): Add.
5556         (cp_parser_iteration_statement): Add call to check_empty_body.
5557
5558 2007-05-05  Geoffrey Keating  <geoffk@apple.com>
5559
5560         PR 31775
5561         * mangle.c (write_mangled_name): Mangle static variable names.
5562         (write_unqualified_name): Use local-source-name for
5563         namespace-scope static variables.
5564
5565 2007-05-04  Dirk Mueller  <dmueller@suse.de>
5566
5567         * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
5568         not in effect.
5569
5570 2007-05-02  Seongbae Park  <seongbae.park@gmail.com>
5571
5572         PR c++/31663
5573         * decl2.c (constrain_class_visibility):
5574         Use strip_pointer_or_array_types instead of strip_array_types.
5575
5576 2007-04-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5577
5578         PR C++/30221
5579         * decl.c (reshape_init_r): Don't reshape the first element if it
5580         is a pointer to member function.
5581
5582 2007-04-27  Simon Baldwin  <simonb@google.com>
5583
5584         * decl.c (grokparms): Changed message format from %qD to %qE.
5585
5586 2007-04-27  Douglas Gregor  <doug.gregor@gmail.com>
5587
5588         * error.c (maybe_warn_variadic_templates): Variadic templates are
5589         now in C++0x, so only warn about them in C++98 mode.
5590
5591 2007-04-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5592
5593         PR C++/30016
5594         * typeck.c (build_reinterpret_cast_1): Only allow conversion to
5595         integeral types from vectors types.
5596
5597 2007-04-26  Jakub Jelinek  <jakub@redhat.com>
5598
5599         PR c++/31598
5600         * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
5601         for type dependent OMP_CLAUSE_DECLs.
5602
5603 2007-04-24  Mark Mitchell  <mark@codesourcery.com>
5604
5605         PR c++/31338
5606         * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
5607         * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
5608         COMPLEX_TYPE is now an ARITHMETIC_TYPE.
5609         * init.c (build_zero_init): Adjust, as
5610         COMPLEX_TYPE is now a SCALAR_TYPE.
5611         * typeck2.c (digest_init): Allow brace-enclosed initializers for
5612         COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
5613
5614 2007-04-25  Paolo Carlini  <pcarlini@suse.de>
5615
5616         * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
5617         per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
5618         (trait_expr_value): Adjust.
5619
5620 2007-04-23  Simon Baldwin  <simonb@google.com>
5621
5622         * decl.c (grokparms): Added new error for duplicate function
5623         parameters names in function prototypes, to match gcc behavior.
5624
5625 2007-04-23  Jan Hubicka  <jh@suse.cz>
5626
5627         * decl2.c (finish_objects): Do not call target constructor/destructor
5628         bits dirrectly.
5629
5630 2007-04-21  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5631
5632         * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
5633         instead of checking GIMPLE_STMT_P in chain_next.
5634
5635 2007-04-17  Mark Mitchell  <mark@codesourcery.com>
5636
5637         PR c++/31513
5638         * call.c (convert_for_arg_passing): Convert bitfields to their
5639         declared types.
5640
5641 2007-04-17  Simon Martin  <simartin@users.sourceforge.net>
5642
5643         PR c++/31517
5644         * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
5645
5646 2007-04-16  Seongbae Park <seongbae.park@gmail.com>
5647
5648         PR c++/29365
5649         * decl2.c (constrain_class_visibility):
5650         Do not warn about the use of anonymous namespace in the main input file.
5651
5652 2007-04-15  Mark Mitchell  <mark@codesourcery.com>
5653
5654         * cp-tree.h (current_template_parms): Fix typo in comment.
5655
5656 2007-04-15  Kazu Hirata  <kazu@codesourcery.com>
5657
5658         * cp-tree.h, error.c: Fix comment typos.
5659
5660 2007-04-13  Jason Merrill  <jason@redhat.com>
5661
5662         PR c++/31074
5663         * call.c (reference_binding): Add c_cast_p parm.  If true,
5664         add quals to TO as needed to make it reference-compatible.
5665
5666 2007-04-11  Jan Hubicka  <jh@suse.cz>
5667
5668         * class.c (convert_to_base_statically): Fold produced tree; verify
5669         that we are not processing template_decl.
5670
5671 2007-04-09  Mark Mitchell  <mark@codesourcery.com>
5672
5673         PR c++/31449
5674         * class.c (build_base_path): Ensure that the converted pointer has
5675         the same cv-qualification as the input.
5676
5677 2007-04-09  Paolo Carlini  <pcarlini@suse.de>
5678
5679         * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
5680
5681 2007-04-08  Steven Bosscher  <steven@gcc.gnu.org>
5682
5683         * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
5684         Do not set it.
5685         (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
5686         * tree.c (cp_add_pending_fn_decls): Remove.
5687         * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
5688
5689 2007-04-07  Daniel Berlin  <dberlin@dberlin.org>
5690
5691         Revert change removing staticp.
5692
5693 2007-04-06  Daniel Berlin  <dberlin@dberlin.org>
5694
5695         * cp-objcp-common.c (cxx_staticp): Remove.
5696         * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
5697         * cp-tree.h (cxx_staticp):
5698
5699 2007-04-04  Danny Smith  <dannysmith.users.sourceforge.net>
5700
5701         * class.c (check_for_override): Don't remove dllmport attribute
5702         of virtual methods.
5703
5704 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
5705
5706         PR c++/30847
5707         * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
5708         type issue error and return early.
5709
5710 2007-03-30  Jason Merrill  <jason@redhat.com>
5711
5712         PR c++/31187
5713         * typeck.c (cp_type_readonly): New fn.
5714         * cp-tree.h: Declare it.
5715         * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
5716         (cp_finish_decl): Not here.
5717
5718 2007-03-31  Richard Guenther  <rguenther@suse.de>
5719
5720         * optimize.c (maybe_clone_body): Replace splay-tree usage by
5721         pointer-map.
5722
5723 2007-03-31  Douglas Gregor  <doug.gregor@gmail.com>
5724
5725         PR c++/31138
5726         PR c++/31140
5727         PR c++/31141
5728         * parser.c (declarator_can_be_parameter_pack): New.
5729         (cp_parser_template_parameter): Only parse the `...' if the
5730         declarator can be a parameter pack.
5731         (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
5732         is NULL.
5733         * pt.c (find_parameter_packs_r): Look into the bounds on integer
5734         types (they could be used as array bounds).
5735         (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
5736         (tsubst_pack_expansion): Handle failure to expand parameter
5737         packs.
5738
5739 2007-03-30  Paolo Carlini  <pcarlini@suse.de>
5740
5741         PR c++/26099
5742         * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
5743         TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
5744         (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
5745         (CLASS_TYPE_NON_UNION_P): Add.
5746         (struct lang_type_class): Add has_complex_dflt.
5747         (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
5748         (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
5749         * cp-tree.def: Add TRAIT_EXPR.
5750         * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
5751         * lex.c (struct resword): Add __has_nothrow_assign,
5752         __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
5753         __has_trivial_constructor, __has_trivial_copy,
5754         __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
5755         __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
5756         __is_pod, __is_polymorphic, __is_union.
5757         * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
5758         (cp_parser_trait_expr): New.
5759         * semantics.c (finish_trait_expr, trait_expr_value
5760         classtype_has_nothrow_copy_or_assign_p): New.
5761         * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
5762         as static.
5763         * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
5764         * class.c (check_bases, check_field_decl, check_bases_and_members):
5765         Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
5766         * pt.c (uses_template_parms, tsubst_copy_and_build,
5767         value_dependent_expression_p, type_dependent_expression_p): Deal with
5768         TRAIT_EXPR.
5769         * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
5770
5771 2007-03-29  Richard Guenther  <rguenther@suse.de>
5772
5773         * tree.c (cp_walk_subtrees): Do not set input_location.
5774
5775 2007-03-28  Simon Martin  <simartin@users.sourceforge.net>
5776
5777         PR c++/29077
5778         * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
5779         destructor.
5780
5781 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5782
5783         * parser.c (struct cp_parser): Update comment for
5784         greater_than_is_operator_p.
5785         (cp_parser_primary_expression): In C++0x mode, a cast operator can
5786         be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
5787         (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
5788         !GREATER_THAN_IS_OPERATOR_P.
5789         (cp_parser_binary_expression): When -Wc++0x-compat, warn about
5790         `>>' operators that will become two `>' tokens in C++0x.
5791         (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
5792         mode, allowing it to terminate default arguments.
5793         (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
5794         `>>' like two consecutive `>' tokens.
5795         (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
5796         (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
5797         ends a template argument.
5798
5799 2007-03-28  Douglas Gregor  <doug.gregor@gmail.com>
5800
5801         * decl.c (redeclaration_error_message): Complain when redeclaring
5802         a friend function with default template arguments (C++0x mode only).
5803         * cp-tree.h (check_default_tmpl_args): Declare.
5804         * pt.c (check_default_tmpl_args): In C++0x mode, permit default
5805         template arguments in function templates. Add support for checking
5806         the default template arguments of friend templates.
5807         (push_template_decl_real): Fix call to check_default_tmpl_args.
5808         (type_unification_real): If a template parameter has not been
5809         deduced but provides a default template argument, substitute into
5810         that default template argument.
5811         * parser.c (cp_parser_init_declarator): When declaring (but not
5812         defining!) a function template in C++0x mode, check for default
5813         template arguments.
5814
5815 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
5816
5817         PR c++/29993
5818         * decl.c (grokdeclarator): Deal with cv-qualified function type
5819         typedefs in the same way for member and non-member functions.
5820
5821 2007-03-26  Dirk Mueller  <dmueller@suse.de>
5822
5823         * parser.c (cp_parser_member_declaration): Pedwarn
5824         about stray semicolons after member declarations.
5825
5826 2007-03-26  Paolo Carlini  <pcarlini@suse.de>
5827
5828         PR c++/30500
5829         * pt.c (instantiate_decl): Set in_system_header.
5830
5831 2007-03-22  Mark Mitchell  <mark@codesourcery.com>
5832
5833         * cp-tree.h (current_tempalte_parms): Improve documentation.
5834         * pt.c (current_template_args): Likewise.
5835
5836         PR c++/30863
5837         * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
5838         not consume tokens when failing.
5839
5840 2007-03-22  Jim Wilson  <wilson@specifix.com>
5841             Mark Mitchell  <mark@codesourcery.com>
5842
5843         PR c++/31273
5844         * call.c (standard_conversion): Use type_decays_to.  Keep FCODE
5845         consistent with FROM.
5846
5847 2007-03-22  Gabriel Dos Reis  <gdr@integrable-solutions.net>
5848
5849         * error.c (dump_expr): Handle dependent names that designate types.
5850         * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
5851
5852 2007-03-17  Kazu Hirata  <kazu@codesourcery.com>
5853
5854         * cp-tree.def, parser.c, pt.c: Fix comment typos.
5855
5856 2007-03-16  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5857
5858         * cvt.c (cp_convert_and_check) : Define.
5859         * cp-tree.h (cp_convert_and_check): Declare.
5860         * call.c (convert_conversion_warnings): Rename to
5861         conversion_null_warnings.  The warning for floating-point to
5862         integer is handled by convert_and_check in convert_like_real.
5863         (convert_like_real): convert_conversion_warnings was renamed as
5864         conversion_null_warnings.
5865         * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
5866         overflow and changes of value during conversion.
5867
5868 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5869
5870         PR c++/30891
5871         * parser.c (cp_parser_statement): If 'namespace' is found, this
5872         only can be a namespace alias definition, so parse it now.
5873         (cp_parser_namespace_alias_definition): if we find an open brace
5874         instead of '=', then this is actually a misplaced namespace
5875         definition.
5876
5877 2007-03-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5878
5879         PR c++/24924
5880         * decl.c (cxx_init_decl_processing): Move command-line options
5881         processing to c-opts.c.
5882
5883 2007-03-15  Douglas Gregor  <doug.gregor@gmail.com>
5884
5885         * ptree.c (cxx_print_type): Use formatting markup for integers
5886         when printing template parameter index/level/orig level.
5887         (cxx_print_xnode): Ditto.
5888         * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
5889         (struct template_parm_index_s): Remove the PARAMETER_PACK member.
5890         Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
5891         HOST_WIDE_INTs.
5892         (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
5893         rather than a HOST_WIDE_INT.
5894         Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
5895         NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
5896         better bit-packing.
5897         (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
5898         RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
5899         IN_BASE_INITIALIZER bool bitfields.
5900         (struct cp_declarator): Make KIND a 4-bit field. Make
5901         PARAMETER_PACK_P a bool bitfield just after KIND.
5902         * pt.c (uses_parameter_packs): Destroy the pointer set.
5903         (make_pack_expansion): Ditto.
5904         (check_for_bare_parameter_packs): Ditto.
5905         * name-lookup.c (push_to_top_level): Make need_pop a bool value.
5906
5907 2007-03-14  Andrew Pinski  <andrew_pinski@playstation.sony.com>
5908
5909         PR c++/31165
5910         * call.c  (convert_default_arg): Instead of copying the node,
5911         unshare it.
5912
5913 2007-03-15  Dirk Mueller  <dmueller@suse.de>
5914
5915         PR c++/30860
5916         * call.c (convert_conversion_warnings): New..
5917         (convert_like_real): .. factored out from here.
5918         (convert_conversion_warnings): Add warning about
5919         false being converted to NULL in argument passing.
5920
5921 2007-03-14  Dirk Mueller  <dmueller@suse.de>
5922
5923         * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
5924         (finish_do_body): Warn about empty body in do/while statement.
5925
5926 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5927
5928         * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
5929
5930 2007-03-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
5931
5932         PR c/21438
5933         * typeck.c (build_binary_op): Call warn_for_div_zero instead of
5934         warning.
5935
5936 2007-03-13  Alexandre Oliva  <aoliva@redhat.com>
5937
5938         * repo.c (init_repo): Initialize random_seed saved options.
5939         (finish_repo): Adjust.
5940
5941 2007-03-13  Mark Mitchell  <mark@codesourcery.com>
5942
5943         PR bootstrap/30899
5944         * Make-lang.in (doc/g++.1): Use $< to specify the location from
5945         which to copy.
5946
5947 2007-03-12  Seongbae Park <seongbae.park@gmail.com>
5948
5949         * decl.c (compute_array_index_type): New warning flag warn_vla.
5950
5951 2007-03-12  Mark Mitchell  <mark@codesourcery.com>
5952
5953         PR c++/30108
5954         * call.c (convert_default_arg): Copy non-constant arguments.
5955
5956 2007-03-11  Mark Mitchell  <mark@codesourcery.com>
5957
5958         PR c++/31038
5959         * parser.c (cp_parser_postfix_expression): Disallow compound
5960         literals in constant expressions.
5961
5962         PR c++/30328
5963         * semantics.c (finish_typeof): Use unlowered_expr_type.
5964
5965 2007-03-10  Mark Mitchell  <mark@codesourcery.com>
5966
5967         PR c++/30274
5968         * cp-tree.h (unlowered_expr_type): New function.
5969         * typeck.c (is_bitfield_expr_with_lowered_type): Handle
5970         COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
5971         (unlowered_expr_type): New function.
5972         (build_unary_op): Disallow predecrements of bool bitfields.
5973         * call.c (build_conditional_expr): Use unlowered_expr_type.
5974         * pt.c (type_unification_real): Likewise.
5975
5976 2007-03-09  Douglas Gregor  <doug.gregor@gmail.com>
5977
5978         PR c++/20599
5979         * typeck.c (check_return_expr): Check for bare parameter packs.
5980         (comptypes): Compare template parameter packs and
5981         type pack expansions.
5982         * decl.c (grokdeclarator): Deal with the declaration of function
5983         parameter packs.
5984         (grokparms): Verify that the (optional) function parameter pack is
5985         at the end of the parameter list.
5986         (xref_basetypes): Handle pack expansions in the base class.
5987         (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
5988         * cp-tree.def (TYPE_ARGUMENT_PACK): New.
5989         (NONTYPE_ARGUMENT_PACK): New.
5990         (TYPE_PACK_EXPANSION): New.
5991         (EXPR_PACK_EXPANSION): New.
5992         (ARGUMENT_PACK_SELECT): New.
5993         * cp-objcp-common.c (cp_tree_size): Compute size of
5994         (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
5995         ARGUMENT_PACK_SELECT.
5996         * error.c (dump_template_argument): Print template argument packs.
5997         (dump_template_argument_list): Ditto.
5998         (dump_template_parameter): Dump `...' for template type parameter
5999         packs.
6000         (dump_type): Dump TYPE_PACK_EXPANSION nodes.
6001         (dump_parameters): Print function parameter packs.
6002         (dump_template_parms): Print template argument packs.
6003         (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
6004         (maybe_warn_variadic_templates): New.
6005         * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
6006         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
6007         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
6008         CAST_EXPR.
6009         * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
6010         (write_template_arg): Write argument packs as separate arguments.
6011         * cp-tree.h (struct template_parm_index_s): Add flag that
6012         indicates that the template parameter is actually a parameter
6013         pack.
6014         (struct tree_argument_pack_select): New.
6015         (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
6016         (union lang_tree_node): Add argument_pack_select.
6017         (FUNCTION_PARAMETER_PACK_P): New.
6018         (PACK_EXPANSION_P): New.
6019         (PACK_EXPANSION_PATTERN): New.
6020         (SET_PACK_EXPANSION_PATTERN): New.
6021         (PACK_EXPANSION_PARAMETER_PACKS): New.
6022         (ARGUMENT_PACK_P): New.
6023         (ARGUMENT_PACK_ARGS): New.
6024         (SET_ARGUMENT_PACK_ARGS): New.
6025         (ARGUMENT_PACK_INCOMPLETE_P): New.
6026         (ARGUMENT_PACK_EXPLICIT_ARGS): New.
6027         (TEMPLATE_PARM_PARAMETER_PACK): New.
6028         (TEMPLATE_TYPE_PARAMETER_PACK): New.
6029         (ARGUMENT_PACK_SELECT_FROM_PACK): New.
6030         (ARGUMENT_PACK_SELECT_INDEX): New.
6031         (ARGUMENT_PACK_SELECT_ARG): New.
6032         (struct cp_declarator): Add parameter_pack_p flag.
6033         (maybe_warn_variadic_templates): Declare.
6034         (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
6035         indicate a template parameter pack.
6036         (uses_parameter_packs): Declare.
6037         (template_parameter_pack_p): Declare.
6038         (template_parms_variadic_p): Declare.
6039         (make_pack_expansion): Declare.
6040         (check_for_bare_parameter_packs): Declare.
6041         * cxx-pretty-print.c (pp_cxx_unary_expression): Print
6042         sizeof... expressions.
6043         (pp_cxx_expression): Print pack expansions and non-type argument
6044         packs.
6045         (pp_cxx_exception_specification): Print pack expansions.
6046         (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
6047         (pp_cxx_ctor_initializer): Print pack expansions.
6048         (pp_cxx_type_id): Print pack expansions.
6049         (pp_cxx_template_argument_list): Print argument packs.
6050         (pp_cxx_template_parameter): Print ellipsis for template parameter
6051         packs.
6052         * pt.c (comp_template_parms): Compare template parameter packs.
6053         (template_parameter_pack_p): New.
6054         (template_parms_variadic_p): New.
6055         (template_args_variadic_p): New.
6056         (make_ith_pack_parameter_name): New.
6057         (struct find_parameter_pack_data): New.
6058         (find_parameter_packs_r): New.
6059         (uses_parameter_packs): New.
6060         (make_pack_expansion): New.
6061         (check_for_bare_parameter_packs): New.
6062         (expand_template_argument_pack): New.
6063         (reduce_template_parm_level): Propagate parameter pack flag.
6064         (process_template_parm): Add is_parameter_pack parameter to state
6065         when the parameter is actually a parameter pack. Create template
6066         parameter packs when is_parameter_pack is true.
6067         (current_template_args): The argument for a template parameter
6068         pack is an argument pack containing a single pack expansion.
6069         (process_partial_specialization): When checking that non-type
6070         argument expressions do not involve template parameters, loop over
6071         the arguments in argument packs separately.
6072         (push_template_decl_real): Check that the type of the declaration
6073         does not have any bare parameter packs. Check that primary
6074         templates have no more than one parameter pack, and that it comes
6075         at the end of the template parameter list.
6076         (convert_template_argument): Handle coercions for pack expansion
6077         expressions by coercing the pattern then rebuilding the expansion.
6078         (coerce_template_parms): When coercing the arguments for a
6079         variadic template, pack "extra" arguments into an argument pack.
6080         (coerce_template_template_parms): Cannot coerce between parameter
6081         packs and non-pack parameters.
6082         (template_args_equal): Compare PACK_EXPANSION_P expressions.
6083         (comp_template_args): Expand all template arguments packs before
6084         comparing template argument lists.
6085         (mangle_class_name_for_template): Make argument packs as separate
6086         template arguments.
6087         (for_each_template_parm_r): No need to handle BASELINK.
6088         (instantiate_class_template): Handle pack expansions in the base
6089         class list.
6090         (tsubst_pack_expansion): New.
6091         (tsubst_template_args): Handle substitutions of argument packs and
6092         pack expansion into template argument lists.
6093         (tsubst_decl): Expand function parameter packs into separate
6094         function parameters.
6095         (tsubst_arg_types): Expand a type pack expansion into separate
6096         argument types.
6097         (tsubst_exception_specification): Handle pack expansions in
6098         exception specifiers.
6099         (tsubst): See through ARGUMENT_PACK_SELECT arguments when
6100         replacing a template parameter with its argument. If we encounter
6101         a substitution for an argument pack, just return the parameter
6102         itself.
6103         (tsubst_copy): sizeof(X...) returns the number of elements in
6104         parameter pack X.  See through ARGUMENT_PACK_SELECT when the
6105         PARM_DECL is a parameter pack.
6106         (tsubst_expr): Expression pack expansions and argument packs
6107         cannot show up here; they will all be handled through function
6108         calls, sizeof, and template argument lists.
6109         (tsubst_copy_and_build): sizeof(X...) returns the number of
6110         elements in parameter pack X.  Handle pack expansions in TREE_LIST
6111         and CONSTRUCTOR nodes.
6112         (fn_type_unification): Handle "incomplete" explicit template
6113         argument lists that specify some of the arguments for a template
6114         parameter pack.
6115         (type_unification_real): Unify arguments against pack expansions.
6116         (template_parm_level_and_index): New, helper function.
6117         (unify_pack_expansion): New.
6118         (unify): Unify argument packs on an argument-by-argument basis,
6119         handling variadic argument packs as well.
6120         (more_specialized_fn): Handle unification of function parameter
6121         packs. All things being equal, prefer non-variadic function
6122         templates to variadic function templates.
6123         (more_specialized_class): Prefer the variadic class template
6124         partial specialization that binds fewer arguments to a parameter
6125         pack.
6126         (regenerate_decl_from_template): Expand function parameter packs
6127         into separate parameters.
6128         (instantiate_decl): Ditto.
6129         (tsubst_initializer_list): Handle pack expansions for base-class
6130         initializers.
6131         (dependent_type_p_r): Determine dependent types in argument packs
6132         and pack expansions.
6133         (value_dependent_expression_p): Determine value-dependence of
6134         non-type argument packs.
6135         (dependent_template_arg_p): Handle argument packs.
6136         * semantics.c (finish_cond): Check for bare parameter packs.
6137         (finish_expr_stmt): Ditto.
6138         (finish_for_expr): Ditto.
6139         (finish_switch_cond): Ditto.
6140         (finish_mem_initializers): Ditto.
6141         * name-lookup.c (arg_assoc_type): Handle pack expansions and
6142         argument packs.
6143         * decl2.c (cp_build_parm_decl): Mark function parameter packs.
6144         * parser.c (make_declarator): Declarator is not an expansion.
6145         (make_pointer_declarator): Transfer parameter pack flag to outer
6146         declarator.
6147         (make_reference_declarator): Ditto.
6148         (make_ptrmem_declarator): Ditto.
6149         (make_call_declarator): Ditto.
6150         (make_array_declarator): Ditto.
6151         (cp_parser_postfix_expression): Allow pack expansion expressions
6152         in the argument list for a call expression.
6153         (cp_parser_parenthesized_expression_list): Add new parameter
6154         ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
6155         into separate arguments."
6156         (cp_parser_new_placement): Allow pack expansion expressions.
6157         (cp_parser_new_initializer): Ditto.
6158         (cp_parser_mem_initializer_list): Allow ellipsis to create a
6159         base-class initializer expansion.
6160         (cp_parser_mem_initializer): Ditto.
6161         (cp_parser_template_parameter_list): Keep track of whether the
6162         template parameter is a template parameter pack.
6163         (cp_parser_template_parameter): Parse the ellipsis to indicate a
6164         template parameter pack.
6165         (cp_parser_type_parameter): Ditto.
6166         (cp_parser_template_argument_list): Parse the ellipsis to indicate
6167         a pack expansion.
6168         (cp_parser_direct_declarator): Parse the ellipsis to indicate that
6169         this declarator is a parameter pack.
6170         (cp_parser_parameter_declaration): The ellipsis does not end the
6171         parameter declaration, because it might be a parameter pack. Parse
6172         the ellipsis to indicate a parameter pack.
6173         (cp_parser_initializer): Allow pack expansions.
6174         (cp_parser_initializer_list): Allow ellipsis to create an
6175         initializer expansion.
6176         (cp_parser_base_clause): Allow ellipsis to create a base specifier
6177         expansion.
6178         (cp_parser_type_id_list): Allow ellipsis to create an exception
6179         specifier expansion.
6180         (cp_parser_attribute_list): Don't allow pack expansions.
6181         (cp_parser_functional_cast): Allow pack expansions.
6182         (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
6183         compute the length of a parameter pack.
6184         (cp_parser_next_token_ends_template_argument_p): An ellipsis can
6185         end a template argument.
6186         * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
6187         NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
6188         CAST_EXPR.
6189
6190 2007-03-09  Dirk Mueller  <dmueller@suse.de>
6191
6192         * call.c (build_new_op): Call warn_logical_operator.
6193
6194 2007-03-08  Volker Reichelt  <v.reichelt@netcologne.de>
6195
6196         PR c++/30852
6197         * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
6198
6199         PR c++/30534
6200         * pt.c (any_template_arguments_need_structural_equality_p):
6201         Robustify.
6202
6203 2007-03-08  Alexandre Oliva  <aoliva@redhat.com>
6204
6205         * decl.c (grokdeclarator): Disable warnings for anonymous
6206         bitfields.
6207
6208 2007-03-05  Volker Reichelt  <v.reichelt@netcologne.de>
6209
6210         * typeck2.c (readonly_error): Always emit a hard error.
6211         Remove last argument.
6212         * cp-tree.h (readonly_error): Adjust prototype.
6213         * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
6214         * typeck.c (build_unary_op): Likewise.
6215         (build_modify_expr): Likewise.
6216
6217 2007-03-04  Simon Martin  <simartin@users.sourceforge.net>
6218
6219         PR c++/30895
6220         * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
6221
6222 2007-03-03  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6223
6224         PR c++/15787
6225         * parser.c (struct cp_parser): New IN_IF_STMT.
6226         (cp_parser_statement_seq_opt): Handle an unexpected 'else',
6227         returning if parsing the body of an 'if' statement or issuing an
6228         error and continuing.
6229         (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
6230         body of 'if'.
6231         (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
6232
6233 2007-03-02  Simon Martin  <simartin@users.sourceforge.net>
6234
6235         PR c++/28253
6236         * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
6237         for thunks.
6238
6239 2007-03-02  Geoffrey Keating  <geoffk@apple.com>
6240
6241         * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
6242         Objective-C++.  Don't exit early if -shared-libgcc needs to be
6243         added.
6244
6245 2007-03-02  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6246
6247         * typeck.c (common_base_type): Delete unused function.
6248
6249 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
6250
6251         * Make-lang.in: Add dummy lang.install-pdf target.
6252
6253 2007-03-01  Simon Baldwin <simonb@google.com>
6254
6255         PR c++/23689
6256         * decl.c (check_tag_decl): Added new warning for typedef ignored
6257         when it precedes an otherwise valid non-typedef declaration.
6258
6259 2007-02-28  Sandra Loosemore  <sandra@codesourcery.com>
6260
6261         * typeck.c (build_function_call): Store converted arguments
6262         in a stack-allocated array instead of building a list.
6263         (convert_arguments): Store arguments in the array passed in as an
6264         argument, and return the actual number of arguments.
6265         * call.c (build_call): Delete, and replace with...
6266         (build_call_n, build_call_a): New.
6267         (build_op_delete_call): Rewrite to avoid constructing argument lists.
6268         (build_over_call): Store converted arguments in a stack-allocated
6269         array instead of building a list.
6270         (build_cxx_call): Pass arguments in an array instead of as a list.
6271         (build_java_interface_fn_ref): Rewrite to avoid constructing
6272         argument lists.
6273         * tree.h: Update declarations to reflect above changes.
6274         * method.c (use_thunk): Use a stack-allocated array to hold
6275         the arguments instead of a list.
6276         * rtti.c (throw_bad_cast): Update call to cxx_call.
6277         (throw_bad_typeid): Likewise.
6278         (build_dynamic_cast_1): Likewise.
6279         * init.c (build_builtin_delete_call): Use build_call_n.
6280         * decl.c (expand_static_init): Likewise.
6281         * except.c (cp_protect_cleanup_actions): Likewise.
6282         * cp-gimplify.c (genericize_eh_spec_block): Likewise.
6283         (gimplify_must_not_throw_expr): Likewise.
6284         (cxx_omp_apply_fn): Use build_call_a.
6285
6286 2007-02-26  Mark Mitchell  <mark@codesourcery.com>
6287
6288         * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
6289         * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
6290
6291 2007-02-25  Mark Mitchell  <mark@codesourcery.com>
6292
6293         * cp-tree.h (static_ctors): Remove.
6294         * cp-tree.h (static_dtors): Likewise.
6295         * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
6296         refactoring of tree_map hierarchy.
6297         (decl_shadowed_for_var_insert): Likewise.
6298         * semantics.c (expand_body): Use c_expand_body.
6299         (expand_or_defer_fn): Don't update static_ctors or static_dtors.
6300         * decl2.c (static_ctors): Remove.
6301         (static_dtors): Likewise.
6302         (generate_ctor_or_dtor_function): Pass NULL_TREE to
6303         objc_generate_static_init_call.  Do not call static_[cd]tors.
6304         (generate_ctor_and_dtor_functions_for_priority): Do not check for
6305         static_[cd]tors.
6306         (cp_write_global_declarations): Likewise.
6307
6308 2007-02-23  Richard Guenther  <rguenther@suse.de>
6309
6310         * class.c (note_name_declared_in_class): Make declaration
6311         changes meaning a pedwarn.
6312
6313 2007-02-22  Michael Matz  <matz@suse.de>
6314
6315         PR c++/29433
6316         * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
6317         * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
6318         dump_function_decl): Guard emitting outer scopes by new flag.
6319         * cp-lang.c (cxx_dwarf_name): New function.
6320         (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
6321         * pt.c (classtype_mangled_name, mangle_class_name_for_template):
6322         Remove functions.
6323         (push_template_decl_real, lookup_template_class): Remove calls
6324         to above functions.
6325
6326 2007-02-19  Mark Mitchell  <mark@codesourcery.com>
6327
6328         * call.c (build_new_method_call): Ensure that explicit calls of
6329         destructors have type "void".
6330
6331 2007-02-19  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6332
6333         * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
6334         and -Walways-true with -Waddress.
6335         * cvt.c (convert_to_void): Replace unconditional warning with
6336         -Waddress.
6337
6338 2007-02-18  Kazu Hirata  <kazu@codesourcery.com>
6339
6340         * decl.c, tree.c: Fix comment typos.
6341
6342 2007-02-15  Andrew Pinski  <andrew_pinski@playstation.sony.com>
6343
6344         PR C++/30158
6345         * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
6346         statement expression if we had an error mark node.
6347
6348 2007-02-15  Sandra Loosemore  <sandra@codesourcery.com>
6349             Brooks Moses  <brooks.moses@codesourcery.com>
6350             Lee Millward  <lee.millward@codesourcery.com>
6351
6352         * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
6353         Change class to tcc_vl_exp.
6354
6355         * call.c (build_call): Use build_call_list instead
6356         of build3.
6357         (build_over_call): Likewise.
6358         (build_new_method_call): Use build_min_non_dep_call_list
6359         instead of build_min_non_dep.
6360
6361         * error.c (dump_call_expr_args): New function.
6362         (dump_aggr_init_expr_args): New function.
6363         (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
6364         Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
6365
6366         * cvt.c (convert_to_void): Use build_call_array instead
6367         of build3; use new AGGR_INIT_EXPR accessor macros.
6368
6369         * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
6370         instead of TREE_CODE_LENGTH.
6371
6372         * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
6373         AGGR_INIT_EXPR accessor macros.
6374
6375         * cp-gimplify.c (cp_gimplify_init_expr): Use
6376         AGGR_INIT_EXPR_SLOT to set the slot operand.
6377
6378         * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
6379         (AGGR_INIT_EXPR_SLOT): New macro.
6380         (AGGR_INIT_EXPR_ARG): New macro.
6381         (aggr_init_expr_nargs): New macro.
6382         (AGGR_INIT_EXPR_ARGP): New macro.
6383         (aggr_init_expr_arg_iterator): New.
6384         (init_aggr_init_expr_arg_iterator): New.
6385         (next_aggr_init_expr_arg): New.
6386         (first_aggr_init_expr_arg): New.
6387         (more_aggr_init_expr_args_p): New.
6388         (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
6389         (stabilize_aggr_init): New declaration.
6390         (build_min_non_dep_call_list): Likewise.
6391
6392         * tree.c (process_aggr_init_operands): New function.
6393         (build_aggr_init_array) New function.
6394         (build_cplus_new): Update to use new CALL_EXPR and
6395         AGGR_INIT_EXPR accessor macros. Replace use of build3 with
6396         build_aggr_init_array.
6397         (build_min_non_dep_call_list) New function.
6398         (build_min_nt): Assert input code parameter is not a variable
6399         length expression class.
6400         (build_min, build_min_non_dep): Likewise.
6401         (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
6402         to check for equality instead of recursing. Handle tcc_vl_exp
6403         tree code classes.
6404         (stabilize_call): Update to only handle CALL_EXPRs, not
6405         AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
6406         (stabilize_aggr_init): New function.
6407         (stabilize_init): Use it.
6408
6409         * cxx-pretty-print.c (pp_cxx_postfix_expression)
6410         <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
6411         AGGR_INIT_EXPR accessor macros and argument iterators.
6412
6413         * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
6414         build_vl_exp. Iterate through the operands, recursively
6415         processing each one.
6416         (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
6417         CALL_EXPR accessor macros.
6418         (value_dependent_expression_p) <default>: Handle tcc_vl_exp
6419         tree code classes. Use TREE_OPERAND_LENGTH instead of
6420         TREE_CODE_LENGTH.
6421
6422         * semantics.c (finish_call_expr): Use build_nt_call_list
6423         instead of build_nt.
6424         (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
6425         accessor macros. Use build_call_array to construct the
6426         CALL_EXPR node instead of build3
6427
6428         * decl2.c (build_offset_ref_call_from_tree): Use
6429         build_nt_call_list and build_min_non_dep_call_list instead
6430         of build_min_nt and build_min_non_dep.
6431
6432         * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
6433         Use build_nt_call_list instead of build_min_nt.
6434
6435 2007-02-15  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6436
6437         PR c++/28943
6438         * call.c (build_conditional_expr): Improve error message.
6439
6440 2007-02-13  Dirk Mueller  <dmueller@suse.de>
6441
6442         * friend.c (do_friend): Annotate warning about friend
6443         declarations in templates with OPT_Wnon_template_friend.
6444         Convert informal message from warning() to inform().
6445
6446 2007-02-12  Simon Martin  <simartin@users.sourceforge.net>
6447             Mark Mitchell  <mark@codesourcery.com>
6448
6449         PR c++/14622
6450         * pt.c (do_decl_instantiation): Detect type mismatches in explicit
6451         instantiations for variables.
6452
6453 2007-02-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6454
6455         PR middle-end/7651
6456         * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
6457         Check warn_unused_value just once.
6458
6459 2007-02-11  Mark Mitchell  <mark@codesourcery.com>
6460
6461         PR c++/26988
6462         * pt.c (determine_specialization): Use skip_artificial_parms_for.
6463         (fn_type_unificiation): Likewise.
6464         (get_bindings): Likewise.
6465
6466 o2007-02-06  Mark Mitchell  <mark@codesourcery.com>
6467
6468         PR target/29487
6469         * decl.c (finish_function): Use DECL_REPLACEABLE.
6470         * tree.c (cp_cannot_inline_tree_fn): Likewise.
6471
6472 2007-02-10  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6473
6474         * parser.c (cp_parser_primary_expression): Reformat overly long lines.
6475
6476 2007-02-10  Richard Henderson  <rth@redhat.com>, Jakub Jelinek  <jakub@redhat.com>
6477
6478         * decl.c (grokvardecl): Don't error if !have_tls.
6479         (grokdeclarator): Likewise.
6480         * parser.c (cp_parser_omp_threadprivate): Likewise.
6481
6482 2007-02-07  Jakub Jelinek  <jakub@redhat.com>
6483
6484         PR c++/30703
6485         * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
6486         parameters and result decls in omp clauses.
6487         (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
6488         by reference.
6489
6490 2007-02-05  Dirk Mueller  <dmueller@suse.de>
6491
6492         PR bootstrap/30510
6493         * parser.c (cp_parser_class_specifier): Always initialize bases.
6494
6495 2007-02-05  Paolo Bonzini  <bonzini@gnu.org>
6496
6497         * cp-tree.h (OMP_ATOMIC_CODE): Delete.
6498         (OMP_ATOMIC_DEPENDENT_P): Rewrite.
6499         * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
6500         expressions.
6501         * semantics.c (finish_omp_atomic): Store a whole expression node
6502         in operand 1, and integer_zero_node in operand 0, for dependent
6503         OMP_ATOMIC.  Rewrite to make flow easier to understand.
6504
6505 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6506
6507         * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
6508
6509 2007-02-04  Kazu Hirata  <kazu@codesourcery.com>
6510
6511         * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
6512         parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
6513
6514 2007-02-03  Douglas Gregor  <doug.gregor@gmail.com>
6515
6516         * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
6517         keyword warning to -Wc++0x-compat.
6518
6519 2007-02-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
6520
6521         * decl.c (grokdeclarator): Update documentation.
6522
6523 2007-02-02  Jakub Jelinek  <jakub@redhat.com>
6524
6525         PR c++/30536
6526         * decl.c (grokdeclarator): If __thread is used together with
6527         a storage class other than extern and static, clear thread_p
6528         after issuing diagnostics and fall through to checking the
6529         storage class.
6530
6531 2007-01-30  Roger Sayle  <roger@eyesopen.com>
6532
6533         * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
6534         calculating the size of an array (to avoid recursive errors).
6535
6536 2007-01-30  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6537
6538         PR c++/24745
6539         * typeck.c (build_binary_op): Fix logic for warning. Move warning
6540         to -Wpointer-arith.
6541         * call.c (convert_like_real): Don't warn when converting to
6542         boolean type.
6543
6544 2007-01-29  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6545
6546         * decl.c (pop_label): Replace warning with call to
6547         warn_for_unused_label.
6548
6549 2007-01-28  Andrew Pinski  <pinskia@gmail.com>
6550
6551         PR C++/28988
6552         * semantics.c (finish_pseudo_destructor_expr): Check the
6553         destrutor name by calling check_dtor_name.
6554
6555 2007-01-24  Douglas Gregor  <dgregor@osl.iu.edu>
6556
6557         * lex.c (D_CPP0X): Rename.
6558         (D_CXX0X): To this.
6559         (reswords): D_CPP0X -> D_CXX0X.
6560         (init_reswords): Ditto.
6561         * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
6562         of C++0x keywords as identifiers.
6563
6564 2007-01-23  Simon Martin  <simartin@users.sourceforge.net>
6565
6566         PR c++/27492
6567         * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
6568         function decls.
6569
6570 2007-01-23  Ian Lance Taylor  <iant@google.com>
6571
6572         * typeck.c (convert_for_assignment): Only warn about a = b = c
6573         when converting to bool.
6574
6575 2007-01-23  Roger Sayle  <roger@eyesopen.com>
6576
6577         * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
6578         TREE_OVERFLOW.
6579         * typeck.c (ignore_overflows): Remove the remaining uses of
6580         TREE_CONSTANT_OVERFLOW.
6581
6582 2007-01-20  Jan Hubicka  <jh@suse.cz>
6583
6584         * decl2.c (start_objects, start_static_storage_duration_function):
6585         Do not make the functions uninlinable.
6586
6587 2007-01-17  Ian Lance Taylor  <iant@google.com>
6588
6589         * class.c (add_method): Call VEC_reserve_exact rather than passing
6590         a negative size to VEC_reserve.
6591
6592 2007-01-11  Simon Martin  <simartin@users.sourceforge.net>
6593
6594         PR c++/29573
6595         * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
6596
6597 2007-01-10  Mark Mitchell  <mark@codesourcery.com>
6598
6599         PR c++/28999
6600         * decl.c (make_typename_type): If the qualified name is not a
6601         type, issue an error.
6602         * parser.c (cp_parser_elaborated_type_specifier): Fix comment
6603         formatting.
6604
6605 2007-01-08  Geoffrey Keating  <geoffk@apple.com>
6606
6607         * rtti.c: Include target.h.
6608         (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
6609         don't emit typeinfo for fundamental types as weak.
6610         * Make-lang.in (cp/rtti.o): Update and correct dependencies.
6611
6612 2007-01-08  Richard Guenther  <rguenther@suse.de>
6613
6614         * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
6615
6616 2007-01-08  Mark Shinwell  <shinwell@codesourcery.com>
6617
6618         * call.c (standard_conversion): Pass flag to
6619         vector_types_convertible_p to disallow emission of note.
6620         * typeck.c (convert_for_assignment): Pass flag to
6621         vector_types_convertible_p to allow emission of note.
6622         (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
6623         to disallow emission of note.
6624
6625 2007-01-07  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6626
6627         PR c++/28986
6628         * typeck.c (build_binary_op): Call overflow_warning if
6629         TREE_OVERFLOW_P is true for the result and not for any of the
6630         operands.
6631
6632 2007-01-06  Lee Millward  <lee.millward@codesourcery.com>
6633
6634         PR c++/19439
6635         * class.c (add_method): Don't wait until template
6636         instantiation time to complain about duplicate methods.
6637
6638 2007-01-05  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
6639
6640         PR c/19978
6641         * semantics.c (finish_unary_op_expr): Warn only if result
6642         overflowed and operands did not.
6643
6644 2007-01-05  Ian Lance Taylor  <iant@google.com>
6645
6646         * typeck.c (build_binary_op): Warn about comparing a non-weak
6647         address to NULL.
6648
6649 2007-01-05  Douglas Gregor  <doug.gregor@gmail.com>
6650
6651         * pt.c (tsubst): Propagate the need for structural equality checks
6652         when reducing the level of template parameters.
6653
6654 2007-01-03  Kazu Hirata  <kazu@codesourcery.com>
6655
6656         * pt.c: Fix a comment typo.
6657
6658 2007-01-02  Ian Lance Taylor  <iant@google.com>
6659
6660         * semantics.c (maybe_convert_cond): Optionally warn when using an
6661         assignment as a condition.
6662         * typeck.c (convert_for_assignment): Optionally warn about
6663         assigning the result of an assignment to a bool.
6664
6665 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
6666
6667         * pt.c (canonical_template_parms): Correct typo in comment.
6668
6669 2007-01-02  Douglas Gregor  <doug.gregor@gmail.com>
6670
6671         * typeck.c (structural_comptypes): Renamed from "comptypes".
6672         (comptypes): Use canonical type information to perform fast type
6673         comparison. When VERIFY_CANONICAL_TYPES, verify that the
6674         canonical type comparison returns the same results as we would see
6675         from the current, structural check. Support COMPARE_STRUCTURAL
6676         when we need structural checks.
6677         * decl.c (typename_compare): Fix comment.
6678         (build_typename_type): TYPENAME_TYPE nodes require structural
6679         equality checks, because they resolve different based on the
6680         current class type.
6681         (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
6682         require structural equality checks (for now).
6683         (build_ptrmemfunc_type): Build the canonical pointer to member
6684         function type.
6685         (compute_array_index_type): Whenever we build a new index type
6686         to represent the size of an array in a template, we need to mark
6687         this index type as requiring structural equality. This goes for
6688         arrays with value-dependent sizes with the current ABI, or all
6689         arrays with ABI-1.
6690         * tree.c (cplus_array_hash): New.
6691         (struct cplus_array_info): New.
6692         (cplus_array_compare): New.
6693         (cplus_array_htab): New.
6694         (build_cplus_array_type_1): Use a hash table to cache the array
6695         types we build. Build the canonical array type for each array
6696         type.
6697         (cp_build_qualified_type_real): When building a cv-qualified array
6698         type, use the hash table of array types and build canonical array
6699         types as necessary.
6700         (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
6701         use structural equality (for now).
6702         * cp-tree.h (COMPARE_STRUCTURAL): New.
6703         * pt.c (canonical_template_parms): New.
6704         (canonical_type_parameter): New.
6705         (process_template_parm): Find the canonical type parameter.
6706         (lookup_template_class): When we have named the primary template
6707         type, set the canonical type for our template class to the primary
6708         template type. If any of the template arguments need structural
6709         equality checks, the template class needs structural equality
6710         checks.
6711         (tsubst): When reducing the level of a template template
6712         parameter, we require structural equality tests for the resulting
6713         parameter because its template parameters have not had their types
6714         canonicalized. When reducing a template type parameter, find the
6715         canonical reduced type parameter.
6716         (any_template_arguments_need_structural_equality_p): New.
6717