OSDN Git Service

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