OSDN Git Service

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