]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/ChangeLog
[multiple changes]
[thirdparty/gcc.git] / gcc / cp / ChangeLog
CommitLineData
5be014d5
AP
12007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2
3 * typeck.c (build_binary_op): For templates build the
4 expression in pieces to avoid the assert in build2_stat.
5 (get_member_function_from_ptrfunc):
6 Change over to using POINTER_PLUS_EXPR and convert
7 the second operand to sizetype.
8 * typeck2.c (build_m_component_ref): Likewise.
9 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
10 instead of PLUS_EXPR for pointers.
11 (build_new_1): Likewise.
12 (build_vec_delete_1): Likewise.
13 (build_vec_delete): Likewise.
14 * class.c (build_base_path): Likewise.
15 (build_base_path): Likewise.
16 (convert_to_base_statically): Likewise.
17 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
18 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
19 instead of PLUS_EXPR.
20 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
21 instead of PLUS_EXPR for pointers.
22 * call.c (build_special_member_call): Likewise.
23 * rtti.c (build_headof): Likewise.
24 Use sizetype instead of ptrdiff_type_node.
25 (tinfo_base_init): Create a POINTER_PLUS_EXPR
26 instead of PLUS_EXPR for pointers.
27 * except.c (expand_start_catch_block): Do a
28 NEGATIVE and then a POINTER_PLUS_EXPR instead
29 of a MINUS_EXPR.
30 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
31 PLUS_EXPR on pointer types over to use
32 POINTER_PLUS_EXPR and remove the conversion
33 to the pointer types.
34 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
35 adding to a pointer type. Use size_int instead of
36 ssize_int. Convert the index to sizetype before
37 adding it to the pointer.
38
555551c2
MM
392007-06-15 Mark Mitchell <mark@codesourcery.com>
40
41 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
42 (DECL_ANON_UNION_VAR_P): New macro.
43 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
44 than DECL_VAR_MARKED_P, to keep track of which variables we have
45 seen.
46 * decl.c (redeclaration_error_message): Complain about redeclaring
47 anonymous union members at namespace scope.
48 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
49
7dbd86a5
GK
502007-06-14 Geoff Keating <geoffk@apple.com>
51
c96f0001
GK
52 * decl2.c (determine_visibility): Ensure that functions with
53 hidden types as parameters are hidden.
54
7dbd86a5
GK
55 PR 31093
56 * decl2.c (determine_visibility): Remove duplicate code for
57 handling type info.
58
058dcc25
ILT
592007-06-12 Ian Lance Taylor <iant@google.com>
60
61 PR libstdc++/29286
62 * init.c (avoid_placement_new_aliasing): New static function.
63 (build_new_1): Call it.
64
b0464c88
RE
652007-06-11 Rafael Avila de Espindola <espindola@google.com>
66
67 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
68 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
69
969c111d
JJ
702007-06-08 Jakub Jelinek <jakub@redhat.com>
71
72 PR c++/32177
73 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
74 on init, the non-decl cond operand and increment value.
75
c1ae8be5
SM
762007-06-07 Simon Martin <simartin@users.sourceforge.net>
77
78 PR c++/30759
79 * decl.c (check_initializer): Report an error when a brace enclosed
80 initializer is used for a non-aggregate type in C++98.
81 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
82 cxx_dialect.
83 (grokdeclarator): Likewise.
84 (move_fn_p): Likewise.
85 * typeck.c (check_return_expr): Likewise.
86 * call.c (reference_binding): Likewise.
87 * error.c (cp_cpp_error): Likewise.
88 * pt.c (check_default_tmpl_args): Likewise.
89 (tsubst): Likewise.
90 * lex.c (init_reswords): Likewise.
91 * parser.c (p_parser_primary_expression): Likewise.
92 (TOKEN_PRECEDENCE): Likewise.
93 (cp_parser_init_declarator): Likewise.
94 (cp_parser_ptr_operator): Likewise.
95 (cp_parser_parameter_declaration): Likewise.
96 (cp_parser_enclosed_template_argument_list): Likewise.
97 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
98 (cp_parser_next_token_ends_template_argument_p): Likewise.
99
b08f991d
SB
1002007-06-04 Simon Baldwin <simonb@google.com>
101
102 * decl.c (grokdeclarator): Readability change. Moved case labels
103 into direct switch statement scope.
104
cab203bf
PC
1052007-06-04 Paolo Carlini <pcarlini@suse.de>
106
107 * call.c (convert_like_real): Remove pointless code.
108
46a9e521
MM
1092007-05-31 Mark Mitchell <mark@codesourcery.com>
110
111 * decl.c (get_atexit_fn_ptr_type): New function.
112 (get_atexit_node): Use it.
113 (start_cleanup_fn): Likewise.
114 (register_dtor_fn): Use the object's destructor, instead of a
115 separate cleanup function, where possible.
116 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
117 (atexit_fn_ptr_type_node): New macro.
118 * decl2.c (build_cleanup): Use build_address.
119
2c751309
DB
1202007-05-31 Daniel Berlin <dberlin@dberlin.org>
121
122 * typeck.c (build_binary_op): Include types in error.
123
32735518
JJ
1242007-05-31 Jakub Jelinek <jakub@redhat.com>
125
126 PR c++/31806
127 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
128 needs runtime initialization.
129
10c1d4af
PC
1302007-05-31 Paolo Carlini <pcarlini@suse.de>
131
132 PR c++/32158
133 * semantics.c (finish_trait_expr): Complete the types.
134
8af2fec4
RY
1352007-05-30 Russell Yanofsky <russ@yanofsky.org>
136 Douglas Gregor <doug.gregor@gmail.com>
137 Pedro Lamarao <pedro.lamarao@mndfck.org>
138 Howard Hinnant <howard.hinnant@gmail.com>
139
140 PR c++/7412
141 PR c++/29939
142 * typeck.c (comptypes): Don't consider rvalue and lvalue
143 reference types to be equivalent.
144 (check_return_expr): Move from certain lvalues when returning
145 them.
146 * decl.c (grokdeclarator): Implement reference collapsing.
147 (copy_fn_p): Don't consider constructors taking rvalue references
148 to be copy constructors.
149 (move_fn_p): New.
5be014d5 150 * call.c (conversion): New "rvaluedness_matches_p" member.
8af2fec4
RY
151 (convert_class_to_reference): Require reference type as first
152 parameter instead of base type.
153 (reference_binding): Add logic to handle rvalue references.
154 (implicit_conversion): Update inaccurate comment.
155 (convert_like_real): Disable creation of temporaries that are
156 impossible to initialize for types with move constructors.
157 (build_over_call): Elide move constructors when possible.
158 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
159 (maybe_handle_ref_bind): Return conversion instead of type node.
160 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
161 determine preferred conversion sequences.
162 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
163 (LOOKUP_PREFER_RVALUE): New.
164 (DECL_MOVE_CONSTRUCTOR_P): New.
165 (struct cp_declarator): Add "reference" member for reference
166 types, with new "rvalue_ref" flag.
167 (cp_build_reference_type): Declare.
168 (move_fn_p): Declare.
169 * error.c (dump_type_prefix): Format rvalue reference types
170 correctly in error messages.
171 * except.c (build_throw): Move from certain lvalues when
172 throwing.
173 * mangle.c (write_type): Mangle rvalue references differently
174 than regular references.
175 * parser.c (make_reference_declarator): Add boolean parameter for
176 rvalue references.
177 (cp_parser_make_indirect_declarator): New.
178 (cp_parser_new_declarator_opt): Call
179 cp_parser_make_indirect_declarator.
180 (cp_parser_conversion_declarator_opt): Ditto.
181 (cp_parser_declarator): Ditto.
182 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
183 declarators.
184 * pt.c (tsubst): Implement reference collapsing.
185 (maybe_adjust_types_for_deduction): Implement special template
186 parameter deduction rule for rvalue references.
187 (type_unification_real): Update calls to
188 maybe_adjust_types_for_deduction.
189 (try_one_overload): Ditto.
190 (unify_pack_expansion): Ditto.
191 * tree.c (lvalue_p_1): Handle rvalue reference types.
192 (cp_build_reference_type): New.
193
27edb548
JJ
1942007-05-30 Jakub Jelinek <jakub@redhat.com>
195
196 PR c++/31809
197 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
198 variables that need runtime initialization.
199
a87db577
AP
2002007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
201
5be014d5 202 PR c++/31339
a87db577
AP
203 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
204 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
205 case POSTDECREMENT_EXPR>): Return the error_mark_node
206 if either the real or imaginary parts would an
207 error_mark_node.
208
1094da91
SM
2092007-05-25 Simon Martin <simartin@users.sourceforge.net>
210 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
211
212 PR c++/31745
213 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
214 token is a closing brace, false if there are no tokens left.
215 (cp_parser_namespace_alias_definition): Only consume the next token if
216 it is a closing brace.
217
218 * parser.c (cp_parser_class_specifier): Likewise.
219
eb89f88c
L
2202007-05-25 H.J. Lu <hongjiu.lu@intel.com>
221
222 * semantics.c (finish_member_declaration): Fix a typo in the
223 last checkin.
224
b1d7b1c0
DG
2252007-05-25 Douglas Gregor <doug.gregor@gmail.com>
226
227 PR c++/31431
228 PR c++/31432
229 PR c++/31434
230 PR c++/31435
231 PR c++/31437
232 PR c++/31438
233 PR c++/31442
234 PR c++/31443
235 PR c++/31444
236 PR c++/31445
237 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
238 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
239 * pt.c (check_for_bare_parameter_packs): Return bool indicated
240 whether everything was okay. Fix indentation.
241 (push_template_decl_real): Check for bare parameter packs in
242 function parameters; where errors occur, mark the parameter types
243 with ERROR_MARK_NODEs to avert ICEs.
244 (coerce_template_parameter_pack): New.
245 (coerce_template_parms): Moved parameter pack coercion into
246 coerce_template_parameter_pack, and permit it anywhere in the
247 template parameter list (not just at the end). Parameter and
248 argument indices can vary (somewhat) separately now, so add
249 PARM_IDX and ARG_IDX.
250 (fn_type_unification): Don't set an argument pack as incomplete if
251 no argument pack was deduced.
252 (type_unification_real): If a type parameter is a parameter pack
253 and has not otherwise been deduced, it will be deduced to an empty
254 parameter pack.
255 (more_specialized_fn): Use the actual lengths of the argument
256 lists when comparing against expansions.
257 * semantics.c (finish_member_declaration): If a field's type has
258 bare parameter packs, error and set its type to ERROR_MARK_NODE.
259
5234b8f5
DS
2602007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
261
262 PR target/27067
263 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
264
8e89cbfe
OW
2652007-05-22 Ollie Wild <aaw@google.com>
266
267 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
268 (unqualified_namespace_lookup): Adds check for hidden types.
269
6936461f
OW
2702007-05-22 Ollie Wild <aaw@google.com>
271
272 * decl.c (duplicate_decls): Verify namespace names are unique.
273
5c113154
MM
2742007-05-21 Mark Mitchell <mark@codesourcery.com>
275
276 * decl.c (cxx_maybe_build_cleanup): Handle
277 __attribute__((cleanup)).
278
7060db96
MLI
2792007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
280
281 * cvt.c (cp_convert_and_check): Don't check warnings if the
282 conversion failed.
283
8d5b1b67
GK
2842007-05-18 Geoffrey Keating <geoffk@apple.com>
285
286 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
287
9c49a5e4
PC
2882007-05-14 Paolo Carlini <pcarlini@suse.de>
289
290 PR c++/29928
291 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
292 type only if is a class type (5.2.8/4).
293
ca5ba2a3
RAE
2942007-05-14 Rafael Avila de Espindola <espindola@google.com>
295
296 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
297 * decl.c (grokdeclarator): Use unsigned_type_for instead of
298 c_common_unsigned_type.
299
79bedddc
SR
3002007-05-11 Silvius Rus <rus@google.com>
301
302 * cp/typeck.c (build_indirect_ref): Add call to
303 strict_aliasing_warning.
304 (build_reinterpret_cast_1): Condition call to
305 strict_aliasing_warning.
306
7be82279
JH
3072007-05-11 Jan Hubicka <jh@suse.cz>
308
309 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
310 * decl2.c (start_objects): ctors and dtors are no longer public.
311 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
312
ee72fa38
AP
3132007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
314
315 * typeck.c (build_unary_op): Remove code that used to
316 handle non lvalue increments/decrements.
317
841cc7da
MS
3182007-05-07 Mike Stump <mrs@apple.com>
319
320 * parser.c (check_empty_body): Add.
321 (cp_parser_iteration_statement): Add call to check_empty_body.
322
a2aa65f0
GK
3232007-05-05 Geoffrey Keating <geoffk@apple.com>
324
325 PR 31775
326 * mangle.c (write_mangled_name): Mangle static variable names.
327 (write_unqualified_name): Use local-source-name for
328 namespace-scope static variables.
329
820b51ae
DM
3302007-05-04 Dirk Mueller <dmueller@suse.de>
331
332 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
333 not in effect.
334
ba992967
SP
3352007-05-02 Seongbae Park <seongbae.park@gmail.com>
336
337 PR c++/31663
338 * decl2.c (constrain_class_visibility):
339 Use strip_pointer_or_array_types instead of strip_array_types.
340
70ec16f7
AP
3412007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
342
343 PR C++/30221
344 * decl.c (reshape_init_r): Don't reshape the first element if it
345 is a pointer to member function.
346
631ee856
SB
3472007-04-27 Simon Baldwin <simonb@google.com>
348
349 * decl.c (grokparms): Changed message format from %qD to %qE.
350
4af96f9f
DG
3512007-04-27 Douglas Gregor <doug.gregor@gmail.com>
352
353 * error.c (maybe_warn_variadic_templates): Variadic templates are
354 now in C++0x, so only warn about them in C++98 mode.
355
d333b74f
AP
3562007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
357
358 PR C++/30016
359 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
360 integeral types from vectors types.
361
6f719560
JJ
3622007-04-26 Jakub Jelinek <jakub@redhat.com>
363
364 PR c++/31598
365 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
366 for type dependent OMP_CLAUSE_DECLs.
367
b8063b29
MM
3682007-04-24 Mark Mitchell <mark@codesourcery.com>
369
fb0b79e5 370 PR c++/31338
b8063b29
MM
371 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
372 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
373 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
374 * init.c (build_zero_init): Adjust, as
375 COMPLEX_TYPE is now a SCALAR_TYPE.
376 * typeck2.c (digest_init): Allow brace-enclosed initializers for
377 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
378
b29441ec
PC
3792007-04-25 Paolo Carlini <pcarlini@suse.de>
380
381 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
382 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
383 (trait_expr_value): Adjust.
384
0d83bf5a
SB
3852007-04-23 Simon Baldwin <simonb@google.com>
386
387 * decl.c (grokparms): Added new error for duplicate function
388 parameters names in function prototypes, to match gcc behavior.
389
09191b7e
JH
3902007-04-23 Jan Hubicka <jh@suse.cz>
391
392 * cp/decl2.c (finish_objects): Do not call target constructor/destructor
393 bits dirrectly.
394
3d95caa4
AP
3952007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
396
397 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
398 instead of checking GIMPLE_STMT_P in chain_next.
399
431ed7a1
MM
4002007-04-17 Mark Mitchell <mark@codesourcery.com>
401
402 PR c++/31513
403 * call.c (convert_for_arg_passing): Convert bitfields to their
404 declared types.
405
f01ec37d
SM
4062007-04-17 Simon Martin <simartin@users.sourceforge.net>
407
408 PR c++/31517
409 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
410
fe24078a
SP
4112007-04-16 Seongbae Park <seongbae.park@gmail.com>
412
413 PR c++/29365
414
415 * cp/decl2.c (constrain_class_visibility):
416 Do not warn about the use of anonymous namespace in the main input file.
417
cac4ddf0
MM
4182007-04-15 Mark Mitchell <mark@codesourcery.com>
419
420 * cp-tree.h (current_template_parms): Fix typo in comment.
421
a57a55de
KH
4222007-04-15 Kazu Hirata <kazu@codesourcery.com>
423
424 * cp-tree.h, error.c: Fix comment typos.
425
44ba4c4e
JM
4262007-04-13 Jason Merrill <jason@redhat.com>
427
428 PR c++/31074
429 * call.c (reference_binding): Add c_cast_p parm. If true,
430 add quals to TO as needed to make it reference-compatible.
431
ffd34392
JH
4322007-04-11 Jan Hubicka <jh@suse.cz>
433
434 * cp/class.c (convert_to_base_statically): Fold produced tree; verify
435 that we are not processing template_decl.
436
a607b96e
MM
4372007-04-09 Mark Mitchell <mark@codesourcery.com>
438
439 PR c++/31449
440 * class.c (build_base_path): Ensure that the converted pointer has
441 the same cv-qualification as the input.
442
ea798d0f
PC
4432007-04-09 Paolo Carlini <pcarlini@suse.de>
444
445 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
446
cb9c159d
SB
4472007-04-08 Steven Bosscher <steven@gcc.gnu.org>
448
449 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
450 Do not set it.
451 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
452 * tree.c (cp_add_pending_fn_decls): Remove.
453 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
454
270c60bb
DB
4552007-04-07 Daniel Berlin <dberlin@dberlin.org>
456
457 Revert change removing staticp.
458
1df918ac
DB
4592007-04-06 Daniel Berlin <dberlin@dberlin.org>
460
461 * cp-objcp-common.c (cxx_staticp): Remove.
462 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
463 * cp-tree.h (cxx_staticp):
464
6acd8838
DS
4652007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
466
467 * class.c (check_for_override): Don't remove dllmport attribute
468 of virtual methods.
469
df3473fa
JJ
4702007-04-03 Jakub Jelinek <jakub@redhat.com>
471
472 PR c++/30847
473 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
474 type issue error and return early.
475
c3b7031d
JM
4762007-03-30 Jason Merrill <jason@redhat.com>
477
478 PR c++/31187
479 * typeck.c (cp_type_readonly): New fn.
480 * cp-tree.h: Declare it.
481 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
482 (cp_finish_decl): Not here.
483
6be42dd4
RG
4842007-03-31 Richard Guenther <rguenther@suse.de>
485
486 * optimize.c (maybe_clone_body): Replace splay-tree usage by
487 pointer-map.
488
d393153e
DG
4892007-03-31 Douglas Gregor <doug.gregor@gmail.com>
490
491 PR c++/31138
492 PR c++/31140
493 PR c++/31141
494 * parser.c (declarator_can_be_parameter_pack): New.
495 (cp_parser_template_parameter): Only parse the `...' if the
496 declarator can be a parameter pack.
497 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
498 is NULL.
499 * pt.c (find_parameter_packs_r): Look into the bounds on integer
500 types (they could be used as array bounds).
501 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
502 (tsubst_pack_expansion): Handle failure to expand parameter
503 packs.
504
cb68ec50
PC
5052007-03-30 Paolo Carlini <pcarlini@suse.de>
506
507 PR c++/26099
508 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
509 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
510 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
511 (CLASS_TYPE_NON_UNION_P): Add.
512 (struct lang_type_class): Add has_complex_dflt.
513 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
514 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
515 * cp-tree.def: Add TRAIT_EXPR.
516 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
517 * lex.c (struct resword): Add __has_nothrow_assign,
518 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
519 __has_trivial_constructor, __has_trivial_copy,
520 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
521 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
522 __is_pod, __is_polymorphic, __is_union.
523 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
524 (cp_parser_trait_expr): New.
525 * semantics.c (finish_trait_expr, trait_expr_value
526 classtype_has_nothrow_copy_or_assign_p): New.
527 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
528 as static.
529 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
530 * class.c (check_bases, check_field_decl, check_bases_and_members):
531 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
532 * pt.c (uses_template_parms, tsubst_copy_and_build,
533 value_dependent_expression_p, type_dependent_expression_p): Deal with
534 TRAIT_EXPR.
535 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
536
2a42f4aa
RG
5372007-03-29 Richard Guenther <rguenther@suse.de>
538
539 * tree.c (cp_walk_subtrees): Do not set input_location.
540
71aea5f2
SM
5412007-03-28 Simon Martin <simartin@users.sourceforge.net>
542
543 PR c++/29077
544 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
545 destructor.
546
a2ca1ab2
DG
5472007-03-28 Douglas Gregor <doug.gregor@gmail.com>
548
549 * parser.c (struct cp_parser): Update comment for
550 greater_than_is_operator_p.
551 (cp_parser_primary_expression): In C++0x mode, a cast operator can
552 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
553 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
554 !GREATER_THAN_IS_OPERATOR_P.
555 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
556 `>>' operators that will become two `>' tokens in C++0x.
557 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
558 mode, allowing it to terminate default arguments.
559 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
560 `>>' like two consecutive `>' tokens.
561 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
562 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
563 ends a template argument.
564
9b7dd5e8
DG
5652007-03-28 Douglas Gregor <doug.gregor@gmail.com>
566
567 * decl.c (redeclaration_error_message): Complain when redeclaring
568 a friend function with default template arguments (C++0x mode only).
569 * cp-tree.h (check_default_tmpl_args): Declare.
570 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
571 template arguments in function templates. Add support for checking
572 the default template arguments of friend templates.
573 (push_template_decl_real): Fix call to check_default_tmpl_args.
574 (type_unification_real): If a template parameter has not been
575 deduced but provides a default template argument, substitute into
576 that default template argument.
577 * parser.c (cp_parser_init_declarator): When declaring (but not
578 defining!) a function template in C++0x mode, check for default
579 template arguments.
580
771026dd
DG
5812007-03-28 Douglas Gregor <doug.gregor@gmail.com>
582
583 PR c++/29993
584 * decl.c (grokdeclarator): Deal with cv-qualified function type
585 typedefs in the same way for member and non-member functions.
586
df12b78f
DM
5872007-03-26 Dirk Mueller <dmueller@suse.de>
588
589 * parser.c (cp_parser_member_declaration): Pedwarn
590 about stray semicolons after member declarations.
591
912291ca
PC
5922007-03-26 Paolo Carlini <pcarlini@suse.de>
593
594 PR c++/30500
595 * pt.c (instantiate_decl): Set in_system_header.
596
8b84995a
MM
5972007-03-22 Mark Mitchell <mark@codesourcery.com>
598
03c17ccd
MM
599 * cp-tree.h (current_tempalte_parms): Improve documentation.
600 * pt.c (current_template_args): Likewise.
601
8b84995a
MM
602 PR c++/30863
603 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
604 not consume tokens when failing.
605
725d6b87
MM
6062007-03-22 Jim Wilson <wilson@specifix.com>
607 Mark Mitchell <mark@codesourcery.com>
608
609 PR c++/31273
610 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
611 consistent with FROM.
612
5a023baa
GDR
6132007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
614
615 * error.c (dump_expr): Handle dependent names that designate types.
616 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
617
a757b5c5
KH
6182007-03-17 Kazu Hirata <kazu@codesourcery.com>
619
620 * cp-tree.def, parser.c, pt.c: Fix comment typos.
621
07231d4f
MLI
6222007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
623
624 * cvt.c (cp_convert_and_check) : Define.
625 * cp-tree.h (cp_convert_and_check): Declare.
626 * call.c (convert_conversion_warnings): Rename to
627 conversion_null_warnings. The warning for floating-point to
628 integer is handled by convert_and_check in convert_like_real.
629 (convert_like_real): convert_conversion_warnings was renamed as
630 conversion_null_warnings.
631 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
632 overflow and changes of value during conversion.
633
2ce88bea
MLI
6342007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
635
636 PR c++/30891
637 * parser.c (cp_parser_statement): If 'namespace' is found, this
638 only can be a namespace alias definition, so parse it now.
639 (cp_parser_namespace_alias_definition): if we find an open brace
640 instead of '=', then this is actually a misplaced namespace
641 definition.
642
9b439fe1
MLI
6432007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
644
645 PR c++/24924
646 * decl.c (cxx_init_decl_processing): Move command-line options
647 processing to c-opts.c.
648
30bcc028
DG
6492007-03-15 Douglas Gregor <doug.gregor@gmail.com>
650
651 * ptree.c (cxx_print_type): Use formatting markup for integers
652 when printing template parameter index/level/orig level.
653 (cxx_print_xnode): Ditto.
654 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
655 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
656 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
657 HOST_WIDE_INTs.
658 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
659 rather than a HOST_WIDE_INT.
660 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
661 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
662 better bit-packing.
663 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
664 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
665 IN_BASE_INITIALIZER bool bitfields.
666 (struct cp_declarator): Make KIND a 4-bit field. Make
667 PARAMETER_PACK_P a bool bitfield just after KIND.
668 * pt.c (uses_parameter_packs): Destroy the pointer set.
669 (make_pack_expansion): Ditto.
670 (check_for_bare_parameter_packs): Ditto.
671 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
672
344bd5a8
AP
6732007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
674
675 PR c++/31165
676 * call.c (convert_default_arg): Instead of copying the node,
677 unshare it.
678
1f7f19c4
DM
6792007-03-15 Dirk Mueller <dmueller@suse.de>
680
681 PR c++/30860
682 * call.c (convert_conversion_warnings): New..
683 (convert_like_real): .. factored out from here.
684 (convert_conversion_warnings): Add warning about
685 false being converted to NULL in argument passing.
686
62e00e94
DM
6872007-03-14 Dirk Mueller <dmueller@suse.de>
688
689 * cp/semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
690 (finish_do_body): Warn about empty body in do/while statement.
691
286d12f9
MLI
6922007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
693
694 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
695
2e9cb75e
MLI
6962007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
697
698 PR c/21438
699 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
700 warning.
701
403d4851
AO
7022007-03-13 Alexandre Oliva <aoliva@redhat.com>
703
704 * cp/repo.c (init_repo): Initialize random_seed saved options.
705 (finish_repo): Adjust.
706
4844b167
MM
7072007-03-13 Mark Mitchell <mark@codesourcery.com>
708
709 PR bootstrap/30899
710 * Make-lang.in (doc/g++.1): Use $< to specify the location from
711 which to copy.
712
50d50fc7
SP
7132007-03-12 Seongbae Park <seongbae.park@gmail.com>
714
715 * decl.c (compute_array_index_type): New warning flag warn_vla.
716
3026f2df
MM
7172007-03-12 Mark Mitchell <mark@codesourcery.com>
718
719 PR c++/30108
720 * call.c (convert_default_arg): Copy non-constant arguments.
721
3c38f0ff
MM
7222007-03-11 Mark Mitchell <mark@codesourcery.com>
723
724 PR c++/31038
725 * parser.c (cp_parser_postfix_expression): Disallow compound
726 literals in constant expressions.
727
728 PR c++/30328
729 * semantics.c (finish_typeof): Use unlowered_expr_type.
730
f9aa54d3
MM
7312007-03-10 Mark Mitchell <mark@codesourcery.com>
732
733 PR c++/30274
734 * cp-tree.h (unlowered_expr_type): New function.
735 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
736 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
737 (unlowered_expr_type): New function.
738 (build_unary_op): Disallow predecrements of bool bitfields.
739 * call.c (build_conditional_expr): Use unlowered_expr_type.
740 * pt.c (type_unification_real): Likewise.
741
5d80a306
DG
7422007-03-09 Douglas Gregor <doug.gregor@gmail.com>
743
744 PR c++/20599
745 * typeck.c (check_return_expr): Check for bare parameter packs.
746 (comptypes): Compare template parameter packs and
747 type pack expansions.
748 * decl.c (grokdeclarator): Deal with the declaration of function
749 parameter packs.
750 (grokparms): Verify that the (optional) function parameter pack is
751 at the end of the parameter list.
752 (xref_basetypes): Handle pack expansions in the base class.
753 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
754 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
755 (NONTYPE_ARGUMENT_PACK): New.
756 (TYPE_PACK_EXPANSION): New.
757 (EXPR_PACK_EXPANSION): New.
758 (ARGUMENT_PACK_SELECT): New.
759 * cp-objcp-common.c (cp_tree_size): Compute size of
760 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
761 ARGUMENT_PACK_SELECT.
762 * error.c (dump_template_argument): Print template argument packs.
763 (dump_template_argument_list): Ditto.
764 (dump_template_parameter): Dump `...' for template type parameter
765 packs.
766 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
767 (dump_parameters): Print function parameter packs.
768 (dump_template_parms): Print template argument packs.
769 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
770 (maybe_warn_variadic_templates): New.
771 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
772 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
773 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
774 CAST_EXPR.
775 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
776 (write_template_arg): Write argument packs as separate arguments.
777 * cp-tree.h (struct template_parm_index_s): Add flag that
778 indicates that the template parameter is actually a parameter
779 pack.
780 (struct tree_argument_pack_select): New.
781 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
782 (union lang_tree_node): Add argument_pack_select.
783 (FUNCTION_PARAMETER_PACK_P): New.
784 (PACK_EXPANSION_P): New.
785 (PACK_EXPANSION_PATTERN): New.
786 (SET_PACK_EXPANSION_PATTERN): New.
787 (PACK_EXPANSION_PARAMETER_PACKS): New.
788 (ARGUMENT_PACK_P): New.
789 (ARGUMENT_PACK_ARGS): New.
790 (SET_ARGUMENT_PACK_ARGS): New.
791 (ARGUMENT_PACK_INCOMPLETE_P): New.
792 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
793 (TEMPLATE_PARM_PARAMETER_PACK): New.
794 (TEMPLATE_TYPE_PARAMETER_PACK): New.
795 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
796 (ARGUMENT_PACK_SELECT_INDEX): New.
797 (ARGUMENT_PACK_SELECT_ARG): New.
798 (struct cp_declarator): Add parameter_pack_p flag.
799 (maybe_warn_variadic_templates): Declare.
800 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
801 indicate a template parameter pack.
802 (uses_parameter_packs): Declare.
803 (template_parameter_pack_p): Declare.
804 (template_parms_variadic_p): Declare.
805 (make_pack_expansion): Declare.
806 (check_for_bare_parameter_packs): Declare.
807 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
808 sizeof... expressions.
809 (pp_cxx_expression): Print pack expansions and non-type argument
810 packs.
811 (pp_cxx_exception_specification): Print pack expansions.
812 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
813 (pp_cxx_ctor_initializer): Print pack expansions.
814 (pp_cxx_type_id): Print pack expansions.
815 (pp_cxx_template_argument_list): Print argument packs.
816 (pp_cxx_template_parameter): Print ellipsis for template parameter
817 packs.
818 * pt.c (comp_template_parms): Compare template parameter packs.
819 (template_parameter_pack_p): New.
820 (template_parms_variadic_p): New.
821 (template_args_variadic_p): New.
822 (make_ith_pack_parameter_name): New.
823 (struct find_parameter_pack_data): New.
824 (find_parameter_packs_r): New.
825 (uses_parameter_packs): New.
826 (make_pack_expansion): New.
827 (check_for_bare_parameter_packs): New.
828 (expand_template_argument_pack): New.
829 (reduce_template_parm_level): Propagate parameter pack flag.
830 (process_template_parm): Add is_parameter_pack parameter to state
831 when the parameter is actually a parameter pack. Create template
832 parameter packs when is_parameter_pack is true.
833 (current_template_args): The argument for a template parameter
834 pack is an argument pack containing a single pack expansion.
835 (process_partial_specialization): When checking that non-type
836 argument expressions do not involve template parameters, loop over
837 the arguments in argument packs separately.
838 (push_template_decl_real): Check that the type of the declaration
839 does not have any bare parameter packs. Check that primary
840 templates have no more than one parameter pack, and that it comes
841 at the end of the template parameter list.
842 (convert_template_argument): Handle coercions for pack expansion
843 expressions by coercing the pattern then rebuilding the expansion.
844 (coerce_template_parms): When coercing the arguments for a
845 variadic template, pack "extra" arguments into an argument pack.
846 (coerce_template_template_parms): Cannot coerce between parameter
847 packs and non-pack parameters.
848 (template_args_equal): Compare PACK_EXPANSION_P expressions.
849 (comp_template_args): Expand all template arguments packs before
850 comparing template argument lists.
851 (mangle_class_name_for_template): Make argument packs as separate
852 template arguments.
853 (for_each_template_parm_r): No need to handle BASELINK.
854 (instantiate_class_template): Handle pack expansions in the base
855 class list.
856 (tsubst_pack_expansion): New.
857 (tsubst_template_args): Handle substitutions of argument packs and
858 pack expansion into template argument lists.
859 (tsubst_decl): Expand function parameter packs into separate
860 function parameters.
861 (tsubst_arg_types): Expand a type pack expansion into separate
862 argument types.
863 (tsubst_exception_specification): Handle pack expansions in
864 exception specifiers.
865 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
866 replacing a template parameter with its argument. If we encounter
867 a substitution for an argument pack, just return the parameter
868 itself.
869 (tsubst_copy): sizeof(X...) returns the number of elements in
870 parameter pack X. See through ARGUMENT_PACK_SELECT when the
871 PARM_DECL is a parameter pack.
872 (tsubst_expr): Expression pack expansions and argument packs
873 cannot show up here; they will all be handled through function
874 calls, sizeof, and template argument lists.
875 (tsubst_copy_and_build): sizeof(X...) returns the number of
876 elements in parameter pack X. Handle pack expansions in TREE_LIST
877 and CONSTRUCTOR nodes.
878 (fn_type_unification): Handle "incomplete" explicit template
879 argument lists that specify some of the arguments for a template
880 parameter pack.
881 (type_unification_real): Unify arguments against pack expansions.
882 (template_parm_level_and_index): New, helper function.
883 (unify_pack_expansion): New.
884 (unify): Unify argument packs on an argument-by-argument basis,
885 handling variadic argument packs as well.
886 (more_specialized_fn): Handle unification of function parameter
887 packs. All things being equal, prefer non-variadic function
888 templates to variadic function templates.
889 (more_specialized_class): Prefer the variadic class template
890 partial specialization that binds fewer arguments to a parameter
891 pack.
892 (regenerate_decl_from_template): Expand function parameter packs
893 into separate parameters.
894 (instantiate_decl): Ditto.
895 (tsubst_initializer_list): Handle pack expansions for base-class
896 initializers.
897 (dependent_type_p_r): Determine dependent types in argument packs
898 and pack expansions.
899 (value_dependent_expression_p): Determine value-dependence of
900 non-type argument packs.
901 (dependent_template_arg_p): Handle argument packs.
902 * semantics.c (finish_cond): Check for bare parameter packs.
903 (finish_expr_stmt): Ditto.
904 (finish_for_expr): Ditto.
905 (finish_switch_cond): Ditto.
906 (finish_mem_initializers): Ditto.
907 * name-lookup.c (arg_assoc_type): Handle pack expansions and
908 argument packs.
909 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
910 * parser.c (make_declarator): Declarator is not an expansion.
911 (make_pointer_declarator): Transfer parameter pack flag to outer
912 declarator.
913 (make_reference_declarator): Ditto.
914 (make_ptrmem_declarator): Ditto.
915 (make_call_declarator): Ditto.
916 (make_array_declarator): Ditto.
917 (cp_parser_postfix_expression): Allow pack expansion expressions
918 in the argument list for a call expression.
919 (cp_parser_parenthesized_expression_list): Add new parameter
920 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
921 into separate arguments."
922 (cp_parser_new_placement): Allow pack expansion expressions.
923 (cp_parser_new_initializer): Ditto.
924 (cp_parser_mem_initializer_list): Allow ellipsis to create a
925 base-class initializer expansion.
926 (cp_parser_mem_initializer): Ditto.
927 (cp_parser_template_parameter_list): Keep track of whether the
928 template parameter is a template parameter pack.
929 (cp_parser_template_parameter): Parse the ellipsis to indicate a
930 template parameter pack.
931 (cp_parser_type_parameter): Ditto.
932 (cp_parser_template_argument_list): Parse the ellipsis to indicate
933 a pack expansion.
934 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
935 this declarator is a parameter pack.
936 (cp_parser_parameter_declaration): The ellipsis does not end the
937 parameter declaration, because it might be a parameter pack. Parse
938 the ellipsis to indicate a parameter pack.
939 (cp_parser_initializer): Allow pack expansions.
940 (cp_parser_initializer_list): Allow ellipsis to create an
941 initializer expansion.
942 (cp_parser_base_clause): Allow ellipsis to create a base specifier
943 expansion.
944 (cp_parser_type_id_list): Allow ellipsis to create an exception
945 specifier expansion.
946 (cp_parser_attribute_list): Don't allow pack expansions.
947 (cp_parser_functional_cast): Allow pack expansions.
948 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
949 compute the length of a parameter pack.
950 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
951 end a template argument.
952 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
953 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
954 CAST_EXPR.
955
63a08740
DM
9562007-03-09 Dirk Mueller <dmueller@suse.de>
957
958 * cp/call.c (build_new_op): Call warn_logical_operator.
959
cc891727
VR
9602007-03-08 Volker Reichelt <reichelt@netcologne.de>
961
1916c916
VR
962 PR c++/30852
963 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
964
cc891727
VR
965 PR c++/30534
966 * pt.c (any_template_arguments_need_structural_equality_p):
967 Robustify.
968
ab53bae2
AO
9692007-03-08 Alexandre Oliva <aoliva@redhat.com>
970
971 * decl.c (grokdeclarator): Disable warnings for anonymous
972 bitfields.
973
fabb00fc
VR
9742007-03-05 Volker Reichelt <reichelt@netcologne.de>
975
976 * typeck2.c (readonly_error): Always emit a hard error.
977 Remove last argument.
978 * cp-tree.h (readonly_error): Adjust prototype.
979 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
980 * typeck.c (build_unary_op): Likewise.
981 (build_modify_expr): Likewise.
982
2a2193e0
SM
9832007-03-04 Simon Martin <simartin@users.sourceforge.net>
984
985 PR c++/30895
986 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
987
4606b05c
MLI
9882007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
989
990 PR c++/15787
991 * parser.c (struct cp_parser): New IN_IF_STMT.
992 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
993 returning if parsing the body of an 'if' statement or issuing an
994 error and continuing.
995 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
996 body of 'if'.
997 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
998
49fedf5a
SM
9992007-03-02 Simon Martin <simartin@users.sourceforge.net>
1000
1001 PR c++/28253
1002 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
1003 for thunks.
1004
f9dedbe3
GK
10052007-03-02 Geoffrey Keating <geoffk@apple.com>
1006
1007 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
1008 Objective-C++. Don't exit early if -shared-libgcc needs to be
1009 added.
1010
4e223867
MLI
10112007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1012
1013 * typeck.c (common_base_type): Delete unused function.
1014
7fe3e184
BM
10152007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1016
1017 * Make-lang.in: Add dummy lang.install-pdf target.
1018
41dc91a8
SB
10192007-03-01 Simon Baldwin <simonb@google.com>
1020
1021 PR c++/23689
1022 * decl.c (check_tag_decl): Added new warning for typedef ignored
1023 when it precedes an otherwise valid non-typedef declaration.
1024
94a0dd7b
SL
10252007-02-28 Sandra Loosemore <sandra@codesourcery.com>
1026
1027 * typeck.c (build_function_call): Store converted arguments
1028 in a stack-allocated array instead of building a list.
1029 (convert_arguments): Store arguments in the array passed in as an
1030 argument, and return the actual number of arguments.
1031 * call.c (build_call): Delete, and replace with...
1032 (build_call_n, build_call_a): New.
1033 (build_op_delete_call): Rewrite to avoid constructing argument lists.
1034 (build_over_call): Store converted arguments in a stack-allocated
1035 array instead of building a list.
1036 (build_cxx_call): Pass arguments in an array instead of as a list.
1037 (build_java_interface_fn_ref): Rewrite to avoid constructing
1038 argument lists.
1039 * tree.h: Update declarations to reflect above changes.
1040 * method.c (use_thunk): Use a stack-allocated array to hold
1041 the arguments instead of a list.
1042 * rtti.c (throw_bad_cast): Update call to cxx_call.
1043 (throw_bad_typeid): Likewise.
1044 (build_dynamic_cast_1): Likewise.
1045 * init.c (build_builtin_delete_call): Use build_call_n.
1046 * decl.c (expand_static_init): Likewise.
1047 * except.c (cp_protect_cleanup_actions): Likewise.
1048 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
1049 (gimplify_must_not_throw_expr): Likewise.
1050 (cxx_omp_apply_fn): Use build_call_a.
1051
57a4c089
MM
10522007-02-26 Mark Mitchell <mark@codesourcery.com>
1053
1054 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
1055 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
1056
fc8600f9
MM
10572007-02-25 Mark Mitchell <mark@codesourcery.com>
1058
1059 * cp-tree.h (static_ctors): Remove.
1060 * cp-tree.h (static_dtors): Likewise.
1061 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
1062 refactoring of tree_map hierarchy.
1063 (decl_shadowed_for_var_insert): Likewise.
1064 * semantics.c (expand_body): Use c_expand_body.
1065 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
1066 * decl2.c (static_ctors): Remove.
1067 (static_dtors): Likewise.
1068 (generate_ctor_or_dtor_function): Pass NULL_TREE to
1069 objc_generate_static_init_call. Do not call static_[cd]tors.
1070 (generate_ctor_and_dtor_functions_for_priority): Do not check for
1071 static_[cd]tors.
1072 (cp_write_global_declarations): Likewise.
1073
2ae2031e
RG
10742007-02-23 Richard Guenther <rguenther@suse.de>
1075
1076 * class.c (note_name_declared_in_class): Make declaration
1077 changes meaning a pedwarn.
1078
a0ad3539
MM
10792007-02-22 Michael Matz <matz@suse.de>
1080
1081 PR c++/29433
1082 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
1083 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
1084 dump_function_decl): Guard emitting outer scopes by new flag.
1085 * cp-lang.c (cxx_dwarf_name): New function.
1086 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
1087 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
1088 Remove functions.
1089 (push_template_decl_real, lookup_template_class): Remove calls
1090 to above functions.
1091
c88b0c50
MM
10922007-02-19 Mark Mitchell <mark@codesourcery.com>
1093
1094 * call.c (build_new_method_call): Ensure that explicit calls of
1095 destructors have type "void".
1096
c116cd05
MLI
10972007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1098
1099 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
1100 and -Walways-true with -Waddress.
1101 * cvt.c (convert_to_void): Replace unconditional warning with
1102 -Waddress.
1103
b9704fc5
KH
11042007-02-18 Kazu Hirata <kazu@codesourcery.com>
1105
1106 * decl.c, tree.c: Fix comment typos.
1107
76b9a2a1
AP
11082007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
1109
1110 PR C++/30158
1111 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
1112 statement expression if we had an error mark node.
5be014d5 1113
5039610b
SL
11142007-02-15 Sandra Loosemore <sandra@codesourcery.com>
1115 Brooks Moses <brooks.moses@codesourcery.com>
1116 Lee Millward <lee.millward@codesourcery.com>
1117
1118 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
1119 Change class to tcc_vl_exp.
1120
1121 * call.c (build_call): Use build_call_list instead
1122 of build3.
1123 (build_over_call): Likewise.
1124 (build_new_method_call): Use build_min_non_dep_call_list
1125 instead of build_min_non_dep.
1126
1127 * error.c (dump_call_expr_args): New function.
1128 (dump_aggr_init_expr_args): New function.
1129 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
1130 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
1131
1132 * cvt.c (convert_to_void): Use build_call_array instead
1133 of build3; use new AGGR_INIT_EXPR accessor macros.
1134
1135 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
1136 instead of TREE_CODE_LENGTH.
1137
1138 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
1139 AGGR_INIT_EXPR accessor macros.
1140
1141 * cp-gimplify.c (cp_gimplify_init_expr): Use
1142 AGGR_INIT_EXPR_SLOT to set the slot operand.
1143
1144 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
1145 (AGGR_INIT_EXPR_SLOT): New macro.
1146 (AGGR_INIT_EXPR_ARG): New macro.
1147 (aggr_init_expr_nargs): New macro.
1148 (AGGR_INIT_EXPR_ARGP): New macro.
1149 (aggr_init_expr_arg_iterator): New.
1150 (init_aggr_init_expr_arg_iterator): New.
1151 (next_aggr_init_expr_arg): New.
1152 (first_aggr_init_expr_arg): New.
1153 (more_aggr_init_expr_args_p): New.
1154 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
1155 (stabilize_aggr_init): New declaration.
1156 (build_min_non_dep_call_list): Likewise.
1157
1158 * tree.c (process_aggr_init_operands): New function.
1159 (build_aggr_init_array) New function.
1160 (build_cplus_new): Update to use new CALL_EXPR and
1161 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
1162 build_aggr_init_array.
1163 (build_min_non_dep_call_list) New function.
1164 (build_min_nt): Assert input code parameter is not a variable
1165 length expression class.
1166 (build_min, build_min_non_dep): Likewise.
1167 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
1168 to check for equality instead of recursing. Handle tcc_vl_exp
1169 tree code classes.
1170 (stabilize_call): Update to only handle CALL_EXPRs, not
1171 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
1172 (stabilize_aggr_init): New function.
1173 (stabilize_init): Use it.
1174
1175 * cxx-pretty-print.c (pp_cxx_postfix_expression)
1176 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
1177 AGGR_INIT_EXPR accessor macros and argument iterators.
1178
1179 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
1180 build_vl_exp. Iterate through the operands, recursively
1181 processing each one.
1182 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
1183 CALL_EXPR accessor macros.
1184 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
1185 tree code classes. Use TREE_OPERAND_LENGTH instead of
1186 TREE_CODE_LENGTH.
1187
1188 * semantics.c (finish_call_expr): Use build_nt_call_list
1189 instead of build_nt.
1190 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
1191 accessor macros. Use build_call_array to construct the
1192 CALL_EXPR node instead of build3
1193
1194 * decl2.c (build_offset_ref_call_from_tree): Use
1195 build_nt_call_list and build_min_non_dep_call_list instead
1196 of build_min_nt and build_min_non_dep.
1197
1198 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
1199 Use build_nt_call_list instead of build_min_nt.
1200
21493102
MLI
12012007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1202
1203 PR c++/28943
1204 * call.c (build_conditional_expr): Improve error message.
1205
20af23d3
DM
12062007-02-13 Dirk Mueller <dmueller@suse.de>
1207
1208 * friend.c (do_friend): Annotate warning about friend
1209 declarations in templates with OPT_Wnon_template_friend.
1210 Convert informal message from warning() to inform().
1211
8ea6dfae
SM
12122007-02-12 Simon Martin <simartin@users.sourceforge.net>
1213 Mark Mitchell <mark@codesourcery.com>
1214
1215 PR c++/14622
1216 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
1217 instantiations for variables.
1218
27f33b15
MLI
12192007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1220
1221 PR middle-end/7651
1222 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
1223 Check warn_unused_value just once.
1224
ba139ba8
MM
12252007-02-11 Mark Mitchell <mark@codesourcery.com>
1226
1227 PR c++/26988
1228 * pt.c (determine_specialization): Use skip_artificial_parms_for.
1229 (fn_type_unificiation): Likewise.
1230 (get_bindings): Likewise.
1231
1232o2007-02-06 Mark Mitchell <mark@codesourcery.com>
56fd65c7
MM
1233
1234 PR target/29487
1235 * decl.c (finish_function): Use DECL_REPLACEABLE.
1236 * tree.c (cp_cannot_inline_tree_fn): Likewise.
1237
097552fa
GDR
12382007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
1239
1240 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
1241
8893239d
RH
12422007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
1243
1244 * decl.c (grokvardecl): Don't error if !have_tls.
1245 (grokdeclarator): Likewise.
1246 * parser.c (cp_parser_omp_threadprivate): Likewise.
1247
e02a048f
JJ
12482007-02-07 Jakub Jelinek <jakub@redhat.com>
1249
1250 PR c++/30703
1251 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
1252 parameters and result decls in omp clauses.
1253 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
1254 by reference.
1255
583c0b05
DM
12562007-02-05 Dirk Mueller <dmueller@suse.de>
1257
1258 PR bootstrap/30510
1259 * parser.c (cp_parser_class_specifier): Always initialize bases.
1260
4fe70b31
PB
12612007-02-05 Paolo Bonzini <bonzini@gnu.org>
1262
1263 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
1264 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
1265 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
1266 expressions.
1267 * semantics.c (finish_omp_atomic): Store a whole expression node
1268 in operand 1, and integer_zero_node in operand 0, for dependent
1269 OMP_ATOMIC. Rewrite to make flow easier to understand.
1270
b10fc6f5
GDR
12712007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1272
1273 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
1274
3b426391
KH
12752007-02-04 Kazu Hirata <kazu@codesourcery.com>
1276
1277 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
1278 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
1279
f1283f8f
DG
12802007-02-03 Douglas Gregor <doug.gregor@gmail.com>
1281
1282 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
1283 keyword warning to -Wc++0x-compat.
1284
5e32a5cf
GDR
12852007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
1286
1287 * decl.c (grokdeclarator): Update documentation.
1288
3e66d096
JJ
12892007-02-02 Jakub Jelinek <jakub@redhat.com>
1290
1291 PR c++/30536
1292 * decl.c (grokdeclarator): If __thread is used together with
1293 a storage class other than extern and static, clear thread_p
1294 after issuing diagnostics and fall through to checking the
1295 storage class.
1296
5e203bf8
RS
12972007-01-30 Roger Sayle <roger@eyesopen.com>
1298
1299 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
1300 calculating the size of an array (to avoid recursive errors).
1301
b9edb4b1
MLI
13022007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1303
1304 PR c++/24745
1305 * typeck.c (build_binary_op): Fix logic for warning. Move warning
1306 to -Wpointer-arith.
1307 * call.c (convert_like_real): Don't warn when converting to
1308 boolean type.
1309
c616e51b
MLI
13102007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1311
1312 * decl.c (pop_label): Replace warning with call to
1313 warn_for_unused_label.
1314
5cf10afb
AP
13152007-01-28 Andrew Pinski <pinskia@gmail.com>
1316
1317 PR C++/28988
1318 * semantics.c (finish_pseudo_destructor_expr): Check the
1319 destrutor name by calling check_dtor_name.
1320
54654d29
DG
13212007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
1322
1323 * lex.c (D_CPP0X): Rename.
1324 (D_CXX0X): To this.
1325 (reswords): D_CPP0X -> D_CXX0X.
1326 (init_reswords): Ditto.
1327 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
1328 of C++0x keywords as identifiers.
1329
815951d8
SM
13302007-01-23 Simon Martin <simartin@users.sourceforge.net>
1331
1332 PR c++/27492
1333 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
1334 function decls.
1335
a99e5cb4
ILT
13362007-01-23 Ian Lance Taylor <iant@google.com>
1337
1338 * typeck.c (convert_for_assignment): Only warn about a = b = c
1339 when converting to bool.
1340
dc569621
RS
13412007-01-23 Roger Sayle <roger@eyesopen.com>
1342
1343 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
1344 TREE_OVERFLOW.
1345 * typeck.c (ignore_overflows): Remove the remaining uses of
1346 TREE_CONSTANT_OVERFLOW.
1347
77dbd49b
JH
13482007-01-20 Jan Hubicka <jh@suse.cz>
1349
1350 * decl2.c (start_objects, start_static_storage_duration_function):
1351 Do not make the functions uninlinable.
1352
efb7e1e0
ILT
13532007-01-17 Ian Lance Taylor <iant@google.com>
1354
1355 * class.c (add_method): Call VEC_reserve_exact rather than passing
1356 a negative size to VEC_reserve.
1357
6f9f76e3
SM
13582007-01-11 Simon Martin <simartin@users.sourceforge.net>
1359
1360 PR c++/29573
1361 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
1362
50ef2c18
MM
13632007-01-10 Mark Mitchell <mark@codesourcery.com>
1364
1365 PR c++/28999
1366 * decl.c (make_typename_type): If the qualified name is not a
1367 type, issue an error.
1368 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
1369 formatting.
1370
157600d0
GK
13712007-01-08 Geoffrey Keating <geoffk@apple.com>
1372
1373 * rtti.c: Include target.h.
1374 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
1375 don't emit typeinfo for fundamental types as weak.
1376 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
1377
2ac7cbb5
RG
13782007-01-08 Richard Guenther <rguenther@suse.de>
1379
1380 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
1381
00c8e9f6
MS
13822007-01-08 Mark Shinwell <shinwell@codesourcery.com>
1383
1384 * call.c (standard_conversion): Pass flag to
1385 vector_types_convertible_p to disallow emission of note.
1386 * typeck.c (convert_for_assignment): Pass flag to
1387 vector_types_convertible_p to allow emission of note.
1388 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
1389 to disallow emission of note.
1390
16fd4d2d
MLI
13912007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1392
1393 PR c++/28986
1394 * typeck.c (build_binary_op): Call overflow_warning if
1395 TREE_OVERFLOW_P is true for the result and not for any of the
1396 operands.
1397
fc40d49c
LM
13982007-01-06 Lee Millward <lee.millward@codesourcery.com>
1399
1400 PR c++/19439
1401 * class.c (add_method): Don't wait until template
1402 instantiation time to complain about duplicate methods.
1403
59c0753d
MLI
14042007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1405
1406 PR c/19978
1407 * semantics.c (finish_unary_op_expr): Warn only if result
1408 overflowed and operands did not.
1409
b3c6d2ea
ILT
14102007-01-05 Ian Lance Taylor <iant@google.com>
1411
1412 * typeck.c (build_binary_op): Warn about comparing a non-weak
1413 address to NULL.
1414
3d761c46
DG
14152007-01-05 Douglas Gregor <doug.gregor@gmail.com>
1416
1417 * pt.c (tsubst): Propagate the need for structural equality checks
1418 when reducing the level of template parameters.
1419
c3e188fc
KH
14202007-01-03 Kazu Hirata <kazu@codesourcery.com>
1421
1422 * pt.c: Fix a comment typo.
1423
2c405565 14242007-01-02 Ian Lance Taylor <iant@google.com>
fbc8d2d3
ILT
1425
1426 * semantics.c (maybe_convert_cond): Optionally warn when using an
1427 assignment as a condition.
1428 * typeck.c (convert_for_assignment): Optionally warn about
1429 assigning the result of an assignment to a bool.
1430
410cf6e6
DG
14312007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1432
1433 * pt.c (canonical_template_parms): Correct typo in comment.
1434
06d40de8
DG
14352007-01-02 Douglas Gregor <doug.gregor@gmail.com>
1436
1437 * typeck.c (structural_comptypes): Renamed from "comptypes".
1438 (comptypes): Use canonical type information to perform fast type
1439 comparison. When VERIFY_CANONICAL_TYPES, verify that the
1440 canonical type comparison returns the same results as we would see
1441 from the current, structural check. Support COMPARE_STRUCTURAL
1442 when we need structural checks.
1443 * decl.c (typename_compare): Fix comment.
1444 (build_typename_type): TYPENAME_TYPE nodes require structural
1445 equality checks, because they resolve different based on the
1446 current class type.
1447 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
1448 require structural equality checks (for now).
1449 (build_ptrmemfunc_type): Build the canonical pointer to member
1450 function type.
1451 (compute_array_index_type): Whenever we build a new index type
1452 to represent the size of an array in a template, we need to mark
1453 this index type as requiring structural equality. This goes for
1454 arrays with value-dependent sizes with the current ABI, or all
1455 arrays with ABI-1.
1456 * tree.c (cplus_array_hash): New.
1457 (struct cplus_array_info): New.
1458 (cplus_array_compare): New.
1459 (cplus_array_htab): New.
1460 (build_cplus_array_type_1): Use a hash table to cache the array
1461 types we build. Build the canonical array type for each array
1462 type.
1463 (cp_build_qualified_type_real): When building a cv-qualified array
1464 type, use the hash table of array types and build canonical array
1465 types as necessary.
1466 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
1467 use structural equality (for now).
1468 * cp-tree.h (COMPARE_STRUCTURAL): New.
1469 * pt.c (canonical_template_parms): New.
1470 (canonical_type_parameter): New.
1471 (process_template_parm): Find the canonical type parameter.
1472 (lookup_template_class): When we have named the primary template
1473 type, set the canonical type for our template class to the primary
1474 template type. If any of the template arguments need structural
1475 equality checks, the template class needs structural equality
1476 checks.
1477 (tsubst): When reducing the level of a template template
1478 parameter, we require structural equality tests for the resulting
1479 parameter because its template parameters have not had their types
1480 canonicalized. When reducing a template type parameter, find the
1481 canonical reduced type parameter.
1482 (any_template_arguments_need_structural_equality_p): New.
1483