OSDN Git Service

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