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