OSDN Git Service

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