c.opt: Add -fno-deduce-init-list.
[gcc.git] / gcc / cp / ChangeLog
1 2009-09-18 Jason Merrill <jason@redhat.com>
2
3 * pt.c (get_pattern_parm): New.
4 (listify): Split out from...
5 (listify_autos): ...here.
6 (unify): Deduce std::initializer_list for T.
7 * call.c (build_over_call): Warn about it.
8
9 2009-09-17 Andrew Pinski <pinskia@gcc.gnu.org>
10
11 PR c++/39365
12 * g++.dg/expr/bool3.C: New test.
13 * g++.dg/expr/bool4.C: New test.
14
15 2009-09-14 Richard Henderson <rth@redhat.com>
16 Jakub Jelinek <jakub@redhat.com>
17
18 * cp-tree.h (finish_asm_stmt): Update decl.
19 * parser.c (cp_parser_asm_definition): Parse asm goto.
20 (cp_parser_asm_label_list): New.
21 * pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
22 (tsubst_expr): Handle asm labels.
23 * semantics.c (finish_asm_stmt): Add and use labels parameter.
24
25 2009-09-14 Richard Henderson <rth@redhat.com>
26
27 * except.c (init_exception_processing): Don't call
28 default_init_unwind_resume_libfunc.
29 (cp_protect_cleanup_actions): Return the decl to call.
30 (build_exc_ptr): Use __builtin_eh_pointer.
31 * optimize.c (clone_body): Set eh_lp_nr, not eh_region.
32
33 2009-09-13 Richard Guenther <rguenther@suse.de>
34 Rafael Avila de Espindola <espindola@google.com>
35
36 * except.c (init_exception_processing): Do not set
37 lang_eh_runtime_type.
38 (choose_personality_routine): Do not set eh_personality_decl,
39 set pragma_java_exceptions.
40 * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
41 (LANG_HOOKS_EH_PERSONALITY): Likewise.
42 (cp_eh_personality_decl): New.
43 (cp_eh_personality): Likewise.
44 * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
45 dependencies.
46
47 2009-09-13 Wei Guozhi <carrot@google.com>
48
49 PR c++/3187
50 * cp/optimize.c (build_delete_destructor_body): New function.
51 (maybe_clone_body): Call build_delete_destructor_body for
52 deleting destructor.
53
54 2009-09-10 Jason Merrill <jason@redhat.com>
55
56 * repo.c (extract_string, get_base_filename, init_repo): constify.
57
58 2009-09-09 Jason Merrill <jason@redhat.com>
59
60 * error.c (find_typenames_r): Also add decltypes.
61
62 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com>
63
64 PR c++/28293
65 * decl2.c (grokfield): Check for explicit template argument lists.
66
67 2009-09-09 Jack Howarth <howarth@bromo.med.uc.edu>
68
69 PR bootstrap/41180
70 * Make-lang.in: Remove redundant code from linkage for darwin10.
71
72 2009-09-08 Paolo Carlini <paolo.carlini@oracle.com>
73
74 PR c++/39923
75 * decl.c (build_init_list_var_init): Check return value of
76 perform_implicit_conversion.
77
78 2009-09-08 Jason Merrill <jason@redhat.com>
79
80 * class.c (currently_open_class): Make sure we're dealing with the
81 main variant.
82
83 * cp-tree.h (enum overload_flags): Remove OP_FLAG.
84 * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
85
86 * name-lookup.c (is_class_level): Remove.
87 (push_binding_level, leave_scope, resume_scope): Adjust.
88 (pushlevel_class): Adjust.
89 (poplevel_class): Make sure we're on class_binding_level.
90
91 * decl.c (grokmethod): Rename from start_method.
92 (finish_method): Remove.
93 * cp-tree.h: Adjust.
94 * parser.c (cp_parser_save_member_function_body): Adjust.
95
96 2009-09-03 Doug Kwan <dougkwan@google.com>
97
98 * tree.c (cp_fix_function_decl_p): New.
99 (cp_free_lang_data): New.
100
101 2009-09-03 Diego Novillo <dnovillo@google.com>
102
103 * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
104 * decl2.c: Include pointer-set.h.
105 (collect_candidates_for_java_method_aliases): New.
106 (cp_write_global_declarations): Call it.
107 Add local variable CANDIDATES. If set, call
108 build_java_method_aliases.
109 (build_java_method_aliases): Add argument CANDIDATES.
110 Use it to determine if FNDECL should get a hidden alias.
111 * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
112 * cp-tree.h (cp_free_lang_data): Declare.
113
114 2009-09-03 Richard Guenther <rguenther@suse.de>
115
116 * method.c (use_thunk): Use cgraph_finalize_function to hand
117 off thunks to the cgraph.
118 * semantics.c (emit_associated_thunks): Do not emit thunks
119 for really extern functions.
120
121 2009-09-03 Diego Novillo <dnovillo@google.com>
122
123 * cp-lang.c (lang_hooks): Remove const qualifier.
124
125 2009-09-02 Jason Merrill <jason@redhat.com>
126
127 * semantics.c (describable_type): Don't pretend to be in a template.
128
129 * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
130
131 2009-09-01 Alexandre Oliva <aoliva@redhat.com>
132
133 * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
134 * cp-lang.c (cxx_dwarf_name): Pass it.
135 * error.c (count_non_default_template_args): Take flags as
136 argument. Adjust all callers. Skip counting of default
137 arguments if the new flag is given.
138
139 2009-09-01 Dodji Seketeli <dodji@redhat.com>
140
141 PR bootstrap/41205
142 * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
143 GNU extension.
144
145 2009-09-01 Richard Guenther <rguenther@suse.de>
146
147 * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
148 * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
149
150 2009-09-01 Richard Guenther <rguenther@suse.de>
151
152 * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
153
154 2009-08-31 Dodji Seketeli <dodji@redhat.com>
155
156 PR debug/30161
157 * cp-tree.h (get_template_info): Parameter should be const.
158 (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
159 (get_template_argument_pack_elems,
160 get_primary_template_innermost_parameters,
161 get_template_innermost_arguments, template_template_parameter_p):
162 Declare ...
163 * pt.c (get_template_argument_pack_elems,
164 get_template_innermost_parameters, get_template_innermost_arguments,
165 template_template_parameter_p):
166 ... New C++ front end implementation of new language hooks.
167 (primary_template_instantiation_p): New private helper.
168 (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
169 printf and strlen.
170 (get_template_info): Const-ify parameter.
171 * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
172 LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
173 LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
174 LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
175 interfaces for the C++ front-end.
176
177 2009-08-31 Jason Merrill <jason@redhat.com>
178
179 PR c++/41127
180 * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
181 type-specifier-seq before we commit.
182
183 2009-08-28 Richard Guenther <rguenther@suse.de>
184
185 PR lto/41058
186 * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
187 into the generic IL.
188
189 2009-08-27 Richard Guenther <rguenther@suse.de>
190
191 * class.c (build_vtbl_ref_1): Remove excess vertical space.
192 * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
193 tracked by $(TREE_H).
194 * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
195
196 2009-08-26 Jason Merrill <jason@redhat.com>
197
198 * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
199 if we're contextually converting to bool.
200 (build_conditional_expr): Likewise.
201 * typeck.c (condition_conversion): Likewise.
202
203 * call.c (build_conditional_expr): Fix logic errors.
204 (build_new_op): Remove dead COND_EXPR handling.
205
206 2009-08-24 Jason Merrill <jason@redhat.com>
207
208 * cp-tree.h (DECL_DEFERRED_FN): Remove.
209 (struct lang_decl_fn): Remove deferred flag.
210 * class.c (build_clone): Don't set it.
211 * decl2.c (note_vague_linkage_fn): Don't check or set it.
212 (mark_used): Don't check it.
213 * method.c (make_thunk, make_alias_for): Don't set it.
214
215 * decl2.c (mark_used): Streamline logic.
216
217 PR c++/41109
218 PR c++/41110
219 PR c++/41134
220 * cp-tree.h (DECL_ODR_USED): New macro.
221 (struct lang_decl_base): Add odr_used flag.
222 * decl.c (duplicate_decls): Propagate it. Use it for error.
223 * pt.c (register_specialization): Use it for error.
224 * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
225 (cp_write_global_declarations): Use it for error.
226 (tree_used_ok): Remove.
227 * cp-tree.h: Remove tree_used_ok.
228 * call.c (build_call_a): Don't call it.
229 * init.c (build_offset_ref): Likewise.
230
231 2009-08-21 Jakub Jelinek <jakub@redhat.com>
232
233 PR c++/41131
234 * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
235 not TREE_STATIC.
236
237 2009-08-19 Jason Merrill <jason@redhat.com>
238
239 PR c++/41119
240 PR c++/41120
241 * decl2.c (mark_used): Increment function_depth during synthesis.
242 * parser.c (cp_parser_default_argument): Not here.
243
244 2009-08-19 Jakub Jelinek <jakub@redhat.com>
245
246 * method.c (use_thunk): Call free_after_compilation after
247 assemble_end_function.
248
249 2009-08-17 Richard Guenther <rguenther@suse.de>
250
251 * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
252 Avoid useless copy.
253 (finish_enum): Keep variant chain intact.
254 * tree.c (cp_build_reference_type): Likewise.
255
256 2009-08-16 Jason Merrill <jason@redhat.com>
257
258 Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
259 and VAR_DECL, so mark_used only has effect the first time.
260 * decl2.c (mark_used): Just return if TREE_USED is already set.
261 Don't set TREE_USED if cp_unevaluated_operand is set.
262 (tree_used_ok): New fn.
263 * init.c (build_offset_ref): Check it instead of TREE_USED.
264 * call.c (build_call_a): Likewise.
265 * cp-tree.h: Declare it.
266 (DECL_NO_LINKAGE_CHECKED): No longer needed.
267 (struct lang_decl_base): Remove no_linkage_checked bitfield.
268
269 * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
270
271 * decl2.c (mark_used): It's ok to synthesize for default args now.
272
273 2009-08-10 Jason Merrill <jason@redhat.com>
274
275 Implement DR 757: It's OK for a decl to use a type without linkage
276 so long as the decl is defined in the current translation unit.
277 * decl2.c (no_linkage_decls): New vector.
278 (mark_used): Add decls that use types with no linkage.
279 (cp_write_global_declarations): Check that they are defined.
280 (decl_defined_p, no_linkage_error): New fns.
281 * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
282 (struct lang_decl_base): Add flag.
283 * decl.c (grokfndecl): Don't check type linkage.
284 (grokvardecl): If the type has no linkage, just make sure
285 DECL_LANG_SPECIFIC is set.
286 * pt.c (check_instantiated_arg): Don't check type linkage.
287 * name-lookup.c (is_local_extern): New fn.
288 * name-lookup.h: Declare it.
289
290 2009-08-05 Jason Merrill <jason@redhat.com>
291
292 PR c++/40948
293 * init.c (build_vec_init): Evaluate the initializer before
294 starting the initialization try block.
295
296 2009-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
297
298 PR c++/36069
299 * typeck.c (convert_for_assignment): Do not warn for any boolean
300 variant. Use explicit location.
301
302 2009-08-04 Dodji Seketeli <dodji@redhat.com>
303
304 PR c++/39987
305 * pt.c (tsubst_default_argument): Let access checks of the
306 default argument happen in the context of the current function.
307
308 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
309
310 PR c++/16696
311 * call.c (build_new_op): Only try prefix operator if -fpermissive,
312 otherwise just error.
313
314 2009-08-04 Dodji Seketeli <dodji@redhat.com>
315
316 PR debug/39706
317 * error.c (lang_decl_name): Print qualified names for decls
318 in namespace scope.
319
320 2009-08-03 Jason Merrill <jason@redhat.com>
321 Jakub Jelinek <jakub@redhat.com>
322
323 PR c++/40948
324 * init.c (build_vec_init): Look through a TARGET_EXPR around a
325 CONSTRUCTOR.
326
327 2009-07-31 Jason Merrill <jason@redhat.com>
328 Douglas Gregor <doug.gregor@gmail.com>
329
330 Remove implicit binding of lvalues to rvalue references (N2831)
331 * call.c (convert_class_to_reference): Binding an lvalue to an
332 rvalue reference is bad. If the user-defined conversion is bad,
333 set bad_p before merging conversions.
334 (maybe_handle_ref_bind): Don't push down bad_p.
335 (reference_binding): Binding an lvalue to an rvalue reference is bad.
336 (convert_like_real): Give a helpful error about binding lvalue
337 to rvalue reference.
338 (reference_related_p): No longer static.
339 * typeck.c (build_typed_address): New.
340 (build_static_cast_1): Add static_cast from lvalue to &&.
341 * cp-tree.h: Adjust.
342
343 2009-07-31 Jason Merrill <jason@redhat.com>
344
345 * call.c (reference_binding): Rename lvalue_p to is_lvalue.
346 Do direct binding of "rvalues" in memory to rvalue references.
347 * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
348 "rvalue" in memory.
349 * typeck.c (build_static_cast_1): Do direct binding of memory
350 "rvalues" to rvalue references.
351 * cvt.c (cp_fold_convert): New.
352 * cp-tree.h: Declare it.
353
354 2009-07-31 Jason Merrill <jason@redhat.com>
355
356 * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
357 * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
358
359 2009-07-29 Jason Merrill <jason@redhat.com>
360
361 PR c++/14912
362 * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
363 * error.c (count_non_default_template_args): Pass it.
364 * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
365
366 2009-07-29 Richard Guenther <rguenther@suse.de>
367
368 PR c++/40834
369 * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
370 vars.
371
372 2009-07-26 Simon Martin <simartin@users.sourceforge.net>
373
374 PR c++/40749
375 * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
376 with a qualified return type.
377
378 2009-07-24 Jason Merrill <jason@redhat.com>
379
380 Core issue 901
381 * call.c (build_op_delete_call): If this is for a new-expression
382 and the op delete is deleted, do nothing.
383
384 Core issue 702
385 * call.c (compare_ics): Give list-initialization of std::init_list
386 priority over conversion to scalar, too.
387
388 2009-07-22 Jason Merrill <jason@redhat.com>
389
390 * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
391 (needs_fake_anon): New.
392 (write_name): Check it.
393 (write_nested_name): Add a fake anonymous namespace scope if true.
394 * name-lookup.c (get_anonymous_namespace_name): No longer static.
395 * rtti.c, cp-tree.h: Adjust.
396
397 2009-07-22 Richard Guenther <rguenther@suse.de>
398
399 PR c++/40799
400 * cp-gimplify.c (cp_gimplify_expr): Move handling of using
401 related exprs to ...
402 (cp_genericize_r): ... genericization stage.
403 (cp_genericize): Adjust.
404
405 2009-07-21 Jason Merrill <jason@redhat.com>
406
407 Core issue 934
408 * call.c (reference_binding): Implement binding to { }.
409 (initialize_reference): Binding temporary to non-const && is fine.
410 * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
411
412 * decl.c (reshape_init_r): { T } is not an aggregate initializer
413 for class T.
414
415 2009-07-17 Richard Guenther <rguenther@suse.de>
416
417 PR c/40401
418 * decl.c (finish_function): Do not emit unused result warnings
419 from here.
420 * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
421 c_warn_unused_result_pass.
422 * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
423 * optimize.c (clone_body): Clone in GENERIC.
424 (maybe_clone_body): Do not clear DECL_SAVED_TREE.
425 * decl2.c (cp_write_global_declarations): Fix body test.
426 Do not call cgraph_optimize.
427 * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
428 * method.c (use_thunk): Register thunk with
429 cgraph_finalize_function.
430 * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
431
432 2009-07-17 Richard Guenther <rguenther@suse.de>
433
434 * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
435 temporary pointer.
436
437 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
438 Manuel López-Ibáñez <manu@gcc.gnu.org>
439
440 PR 40435
441 * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
442 tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
443 call.c, cvt.c, mangle.c: Add location argument to
444 fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
445 build_size_arg, build_fold_addr_expr, build_call_array,
446 non_lvalue, size_diffop, fold_build1_initializer,
447 fold_build2_initializer, fold_build3_initializer,
448 fold_build_call_array, fold_build_call_array_initializer,
449 fold_single_bit_test, omit_one_operand, omit_two_operands,
450 invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
451 fold_indirect_ref, combine_comparisons, fold_builtin_*,
452 fold_call_expr, build_range_check, maybe_fold_offset_to_address,
453 round_up, round_down.
454
455 2009-07-16 Jason Merrill <jason@redhat.com>
456
457 PR libstdc++/37907
458 Split POD into "standard-layout" and "trivial" as per N2230,
459 Support std::is_standard_layout and std::is_trivial traits.
460 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
461 CPTK_IS_TRIVIAL.
462 (struct lang_type_class): Add non_std_layout.
463 (CLASSTYPE_NON_STD_LAYOUT): New.
464 * class.c (check_bases): Set it.
465 (check_field_decls): Likewise.
466 (check_bases_and_members): Likewise.
467 * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
468 RID_IS_TRIVIAL.
469 (cp_parser_trait_expr): Likewise.
470 * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
471 CPTK_IS_TRIVIAL.
472 (finish_trait_expr): Likewise.
473 * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
474 (pod_type_p): Use them.
475 (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
476
477 Adjust bits of the language that no longer refer to POD types.
478 * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
479 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
480 (build_x_va_arg): Likewise.
481 (call_builtin_trap): Remove.
482 * decl.c (declare_local_label): Use type_has_nontrivial_default_init
483 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
484 (cp_finish_decl): Likewise.
485 (check_previous_goto_1, check_goto): Adjust error.
486 * typeck.c (build_class_member_access_expr): Check
487 CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
488
489 2009-07-14 Taras Glek <tglek@mozilla.com>
490 Rafael Espindola <espindola@google.com>
491
492 * Make-lang.in: Added CP_PLUGIN_HEADERS and
493 c.install-target to export cp-tree.h cxx-pretty-print.h
494 name-lookup.h headers for plugins.
495
496 2009-07-14 Jason Merrill <jason@redhat.com>
497
498 PR c++/37276
499 * decl.c (decls_match): A non-extern-C declaration doesn't match
500 a builtin extern-C declaration.
501
502 PR c++/40746
503 * name-lookup.c (qualified_lookup_using_namespace): Don't stop
504 looking in used namespaces just because we found something on
505 another branch.
506
507 PR c++/40740
508 * semantics.c (perform_koenig_lookup): Handle empty template args.
509
510 * call.c (build_over_call): Use can_trust_pointer_alignment.
511
512 2009-07-14 Dodji Seketeli <dodji@redhat.com>
513
514 PR debug/40705
515 PR c++/403057
516 * decl2.c (grokfield): Don't call set_underlying_type on typedef
517 decls that are type names.
518
519 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
520
521 PR C++/22154
522 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
523 front of qualified names.
524
525 2009-07-12 Jason Merrill <jason@redhat.com>
526
527 PR c++/36628
528 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
529
530 PR c++/37206
531 * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
532 * tree.c (lvalue_p_1): Return it. Remove
533 treat_class_rvalues_as_lvalues parm.
534 (real_lvalue_p): Disallow pseudo-lvalues here.
535 (lvalue_or_rvalue_with_address_p): New fn.
536 * call.c (initialize_reference): Use it instead of real_lvalue_p.
537
538 PR c++/40689
539 * init.c (build_new_1): Handle initializer list as array initializer.
540 (build_vec_init): Likewise.
541 * typeck.c (cp_build_modify_expr): Likewise.
542 * typeck2.c (process_init_constructor_array): Error rather than abort
543 if too many initializers.
544
545 2009-07-10 Jakub Jelinek <jakub@redhat.com>
546
547 PR c++/40502
548 * error.c (cp_print_error_function): Check for NULL block.
549
550 2008-07-09 Simon Martin <simartin@users.sourceforge.net>
551 Jason Merrill <jason@redhat.com>
552
553 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
554 append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
555
556 2009-07-09 Dodji Seketeli <dodji@redhat.com>
557
558 PR c++/40684
559 * pt.c (type_unification_real): Use tsubst_template_arg instead
560 of tsubst to substitute default template arguments.
561
562 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
563
564 PR c++/31246
565 * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
566 code.
567 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
568
569
570 2009-07-07 Jason Merrill <jason@redhat.com>
571
572 PR c++/35828
573 * pt.c (tsubst_decl): Don't abort if we didn't change anything
574 in a TEMPLATE_DECL's args.
575
576 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
577
578 * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
579 EXPR_LOCATION.
580
581 2009-07-07 Jason Merrill <jason@redhat.com>
582
583 PR c++/37816
584 * decl.c (build_enumerator): Don't add enumerators for a
585 scoped enum to the enclosing class.
586
587 PR c++/40639
588 * decl.c (start_enum): Allow dependent underlying type.
589
590 PR c++/40633
591 * decl.c (finish_enum): Finish scope even in a template.
592
593 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
594
595 * init.c: Replace %J by an explicit location. Update all calls.
596 * decl.c: Likewise.
597 * typeck2.c: Likewise.
598 * pt.c: Likewise.
599 * name-lookup.c: Likewise.
600
601 2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
602
603 * decl.c: Replace %H by an explicit location. Update all calls.
604 * except.c: Likewise.
605 * semantics.c: Likewise.
606 * parser.c: Likewise.
607
608 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
609
610 PR c++/40557
611 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
612 append_type_to_template_for_access_check_1): Use
613 RECORD_OR_UNION_CODE_P.
614
615 2009-07-04 Jason Merrill <jason@redhat.com>
616
617 * pt.c (retrieve_specialization): Don't get confused by a
618 using-declaration that brings in another instance of this template
619 from a base class.
620
621 * ptree.c (cxx_print_type): Fix logic.
622
623 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
624
625 PR c++/40619
626 * cp-tree.h (struct lang_decl_parm): New.
627 (struct lang_decl): Add it.
628 (LANG_DECL_PARM_CHECK): New.
629 (DECL_PARM_INDEX): New.
630 * decl2.c (parm_index): Remove.
631 * lex.c (retrofit_lang_decl): Handle parms.
632 (cxx_dup_lang_specific_decl): Likewise.
633 * mangle.c (write_expression): Adjust.
634 * tree.c (cp_tree_equal): Adjust.
635 (decl_linkage): Only check DECL_COMDAT for functions and variables.
636 * parser.c (cp_parser_parameter_declaration_list): Set
637 DECL_PARM_INDEX.
638 * pt.c (iterative_hash_template_arg): Hash it.
639
640 2009-07-03 Jason Merrill <jason@redhat.com>
641
642 * cp-tree.h (struct lang_decl): Overhaul.
643 (struct lang_decl_flags): Remove.
644 (struct lang_decl_base): New.
645 (struct lang_decl_min): New.
646 (struct lang_decl_fn): New.
647 (struct lang_decl_ns): New.
648 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
649 (LANG_DECL_MIN_CHECK): New.
650 (LANG_DECL_FN_CHECK): New.
651 (LANG_DECL_NS_CHECK): New.
652 (STRIP_TEMPLATE): New.
653 (NON_THUNK_FUNCTION_CHECK): Remove.
654 (DECL_DECLARES_FUNCTION_P): New.
655 (lots): Adjust.
656 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
657 * decl.c (push_local_name, duplicate_decls): Adjust.
658 * decl2.c (start_objects): Don't set u2sel.
659 * semantics.c (finish_omp_threadprivate): Adjust.
660 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
661 (decl_cloned_function_p): Out-of-line implementation of macros.
662 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
663 * mangle.c (write_unqualified_name): Don't check function flags
664 on non-functions.
665 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
666 * pt.c (build_template_decl): Don't set function flags.
667 (check_default_tmpl_args): Check that it's a function.
668 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
669 cloned template.
670
671 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
672 DECL_CLONED_FUNCTION.
673
674 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
675 * class.c (finish_struct_1): Adjust.
676 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
677 * search.c (lookup_field_1): Adjust.
678
679 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
680 * decl.c (finish_method): Don't add to it.
681 * class.c (fixup_pending_inline): Remove.
682 (fixup_inline_methods): Remove.
683 (finish_struct_1): Don't call it.
684
685 * error.c (dump_function_name): Handle null name.
686
687 2009-07-02 Mark Mitchell <mark@codesourcery.com>
688
689 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
690 in arithmetic earlier and allow comparisions of NULL with
691 pointers-to-members.
692
693 2009-07-02 Jason Merrill <jason@redhat.com>
694
695 Use hash tables for template specialization lookup.
696 * pt.c (struct spec_entry): New type.
697 (decl_specializations, type_specializations): New hash tables.
698 (register_specialization, retrieve_specialization): Use them.
699 (reregister_specialization, lookup_template_class): Use them.
700 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
701 (iterative_hash_template_arg): New.
702 (init_template_processing): New
703 (process_partial_specialization): Don't look to see if we already
704 have this partial specialization.
705 (maybe_process_partial_specialization): Handle reassigning
706 full specializations when we get an explicit specialization
707 of the partial instantiation.
708 (tsubst_friend_function): Adjust specialization reassignment code.
709 (instantiate_template): Only do one lookup.
710 (instantiate_decl): Don't do any lookup.
711 * cp-tree.h: Declare init_template_processing.
712 * decl.c (duplicate_decls): Pass args to reregister_specialization.
713
714 2009-07-01 Jason Merrill <jason@redhat.com>
715
716 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
717
718 * pt.c (register_specialization): Use duplicate_decls to merge
719 the argument with a previous specialization.
720 (check_explicit_specialization): Call register_specialization to
721 merge the TEMPLATE_DECL with a previous version.
722 (determine_specialization): Return the args even if fn is a template.
723
724 2009-07-01 Ian Lance Taylor <iant@google.com>
725
726 * g++spec.c (lang_specific_driver): Bump num_args by 1.
727
728 2009-06-30 Jason Merrill <jason@redhat.com>
729
730 PR c++/40595
731 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
732 EXPR_PACK_EXPANSION.
733
734 2009-06-29 Jason Merrill <jason@redhat.com>
735
736 PR c++/40274
737 * error.c (dump_template_parms): Pass all args to
738 count_non_default_template_args.
739 (count_non_default_template_args): Pull out the inner ones.
740
741 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
742
743 * decl.c (duplicate_decls): Re-indent.
744
745 2009-06-25 Ian Lance Taylor <iant@google.com>
746
747 * call.c (avoid_sign_compare_warnings): New static function.
748 (build_new_op): Call it.
749 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
750 TREE_NO_WARNING is set on either operand.
751
752 2009-06-25 Ian Lance Taylor <iant@google.com>
753
754 * g++spec.c (SKIPOPT): define.
755 (lang_specific_driver): Handle -static-libstdc++. Only add
756 LIBSTDCXX_STATIC if we add LIBSTDCXX.
757
758 2009-06-25 Ian Lance Taylor <iant@google.com>
759
760 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
761 the second nor third operand has side effects.
762
763 2009-06-25 Ian Lance Taylor <iant@google.com>
764
765 * parser.c (cp_parser_binary_expression): Increment
766 c_inhibit_evaluation_warnings while parsing the right hand side of
767 "true || x" or "false && x".
768 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
769 if c_inhibit_evaluation_warnings is zero.
770
771 2009-06-24 Jason Merrill <jason@redhat.com>
772
773 * error.c (dump_decl): Do say "typedef" for the injected class name.
774
775 * pt.c (lookup_template_class): Use currently_open_class,
776 compare template args later.
777
778 PR c++/40342
779 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
780 * class.c (resolve_address_of_overloaded_function): Fix typo.
781
782 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
783
784 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
785 * decl.c (finish_decl): Remove.
786 (declare_global_var): Replace finish_decl with cp_finish_decl.
787 (start_method): Same.
788 * rtti.c (emit_tinfo_decl): Same.
789 * pt.c (tsubst_expr): Same.
790 (instantiate_decl): Same.
791 * decl2.c (grokbitfield): Same.
792 * name-lookup.c (pushdecl_top_level_1): Same.
793 * cp-tree.h: Remove finish_decl.
794
795 2009-06-16 David Edelsohn <edelsohn@gnu.org>
796
797 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
798 (lang_specific_driver): Always allocate extra argument.
799 Add LIBSTDCXX_STATIC to arglist if defined and linking
800 statically.
801
802 2009-06-16 Ian Lance Taylor <iant@google.com>
803
804 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
805 (cp/semantics.o): Depend upon gt-cp-semantics.h.
806
807 2009-06-16 Ian Lance Taylor <iant@google.com>
808
809 * parser.c (cp_unevaluated_operand): Define global variable.
810 (cp_parser_question_colon_clause): Increment
811 c_inhibit_evaluation_warnings when evaluating an expression which
812 will never be executed.
813 (cp_parser_decltype): Increment cp_unevaluated_operand and
814 c_inhibit_evaluation_warnings, not skip_evaluation.
815 (cp_parser_sizeof_operand): Likewise.
816 (cp_parser_enclosed_template_argument_list): Save
817 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
818 skip_evaluation.
819 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
820 Add unevaluated_operand and inhibit_evaluation_warnings fields.
821 (cp_unevaluated_operand): Declare.
822 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
823 and c_inhibit_evaluation_warnings rather than skip_evaluation.
824 (pop_from_top_level): Restore cp_unevaluated_operand and
825 c_inhibit_evaluation_warnings rather than skip_evaluation.
826 * class.c (build_base_path): Check cp_unevaluated_operand rather
827 than skip_evaluation.
828 * typeck.c (build_class_member_access_expr): Likewise.
829 (cp_build_binary_op): Don't warn about bad shift counts if
830 c_inhibit_evaluation_warnings is non-zero.
831 * pt.c (coerce_template_parms): Save state of
832 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
833 skip_evaluation.
834 (tsubst_aggr_type): Likewise.
835 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
836 skip_evaluation.
837 (tsubst_copy): Likewise.
838 (tsubst): Set cp_unevaluated_operand and
839 c_inhibit_evaluation_warnings, not skip_evaluation.
840 (tsubst_copy_and_build): Likewise.
841 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
842 rather than skip_evaluation.
843 * decl2.c (mark_used): Likewise.
844 * semantics.c (finish_non_static_data_member): Likewise.
845 * cvt.c (cp_convert_and_check): Check
846 c_inhibit_evaluation_warnings rather than skip_evaluation.
847 * mangle.c (write_type): Set cp_unevaluated_operand rather than
848 skip_evaluation.
849
850 2009-06-15 Ian Lance Taylor <iant@google.com>
851
852 * parser.c (cp_parser_direct_declarator): Add braces around
853 variables declared before label.
854
855 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
856
857 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
858 * cp-tree.h (cxx_comdat_group): Change signature.
859 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
860 (cxx_comdat_group): Change signature.
861 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
862 make_decl_one_only.
863 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
864 * method.c (use_thunk): Update call to make_decl_one_only.
865 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
866
867 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
868
869 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
870 (build_modify_expr): New arg.
871 * semantics.c (finish_unary_op_expr): Pass location to
872 overflow_warning.
873 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
874 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
875 c_sizeof_or_alignof_type.
876 (build_array_ref): New argument.
877 (build_compound_expr): Same.
878 (build_const_cast): Same.
879 (build_ptrmemfunc): Pass location to build_c_cast.
880 * init.c (avoid_placement_new_aliasing): Pass location to
881 build_stmt.
882 (build_vec_delete_1): Pass location to cp_build_modify_expr,
883 build_compound_expr.
884 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
885 * decl.c (poplevel): Pass location to c_build_bind_expr.
886 (finish_case_label): Pass location to build_case_label.
887 (finish_constructor_body): Same.
888 (finish_destructor_body): Pass location to build_stmt.
889 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
890 * call.c (build_new_op): Pass location to build_array_ref.
891 (build_x_va_arg): Pass location to build_va_arg.
892 * except.c (expand_end_catch_block): Pass location to
893 build_stmt.
894 * cp-tree.h (build_array_ref): New argument.
895 (build_compound_expr): Same.
896 (build_c_cast): Same.
897 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
898 (gimplify_switch_stmt): Same.
899 * typeck2.c (split_nonconstant_init_1): Same.
900 * pt.c (tsubst_copy): Same.
901 * semantics.c (add_decl_expr): Same.
902 (do_poplevel): Same.
903 (push_cleanup): Same.
904 (finish_goto_stmt): Same.
905 (finish_expr_stmt): Same.
906 (begin_if_stmt): Same.
907 (begin_while_stmt): Same.
908 (begin_do_stmt): Same.
909 (finish_return_stmt): Same.
910 (begin_for_stmt): Same.
911 (finish_break_stmt): Same.
912 (finish_continue_stmt): Same.
913 (begin_switch_stmt): Same.
914 (begin_try_block): Same.
915 (begin_handler): Same.
916 (finish_asm_stmt): Same.
917 (finish_label_stmt): Same.
918 (finish_stmt_expr_expr): Same.
919 (finalize_nrv_r): Same.
920 (finish_omp_atomic): Same.
921 * name-lookup.c (do_using_directive): Same.
922 * decl2.c (grok_array_decl): Same.
923 * parser.c (cp_parser_cast_expression): Same.
924 (cp_parser_selection_statement): Same.
925 (cp_parser_implicitly_scoped_statement): Same.
926 (cp_parser_objc_selector_expression): Same.
927 (cp_parser_objc_synchronized_statement): Same.
928 (cp_parser_objc_throw_statement): Same.
929 (cp_parser_omp_critical): Same.
930 (cp_parser_omp_master): Same.
931 * typeck.c (build_function_call): Add location argument.
932 * init.c: Add location argument to all build_decl calls.
933 * class.c: Same.
934 * method.c: Same.
935 * rtti.c: Same.
936 * tree.c: Same.
937 * pt.c: Same.
938 * semantics.c: Same.
939 * lex.c: Same.
940 * decl2.c: Same.
941 * cp-gimplify.c: Same.
942 * decl.c: Same.
943 (cp_make_fname_decl): Add location argument. Pass location ot
944 build_decl.
945 (finish_case_label): Same.
946 * cp-tree.h (finish_case_label): Add location argument.
947 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
948 finish_case_label.
949
950 2009-06-09 Jason Merrill <jason@redhat.com>
951
952 PR c++/40381
953 * decl2.c (mark_used): Return after complaining about deleted fn.
954
955 2009-06-08 Jason Merrill <jason@redhat.com>
956
957 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
958 late-specified return type.
959
960 2009-06-08 Jakub Jelinek <jakub@redhat.com>
961
962 PR c++/40373
963 * call.c (check_dtor_name): Return false even if
964 get_type_value (name) is error_mark_node.
965
966 PR c++/40370
967 PR c++/40372
968 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
969 on error_mark_node. Check for VLAs outside of function context
970 before check whether to wrap bounds into a NOP_EXPR with
971 TREE_SIDE_EFFECTS.
972
973 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
974
975 * repo.c (get_base_filename): Use aux_base_name rather than
976 alternate temporary file during second compare debug compilation.
977 (finish_repo): Skip during -fcompare-debug-second.
978
979 2009-06-06 Ian Lance Taylor <iant@google.com>
980
981 * parser.c (cp_parser_label_for_labeled_statement): Support
982 attribute on labels if immediately followed by semicolon.
983 * semantics.c (finish_label_stmt): Return new label.
984 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
985
986 2009-06-03 Ian Lance Taylor <iant@google.com>
987
988 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
989 $(SYSTEM_H).
990
991 2009-06-02 Mark Mitchell <mark@codesourcery.com>
992
993 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
994
995 2009-06-02 Jason Merrill <jason@redhat.com>
996
997 PR c++/40308
998 PR c++/40311
999 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
1000 conversion code.
1001 * call.c (implicit_conversion): Allow init-list conversion to scalar
1002 during direct-initialization, too. Mark the conversion bad if it
1003 has too many levels of braces.
1004 (convert_like_real): And give a helpful error.
1005
1006 PR c++/40306
1007 PR c++/40307
1008 * decl.c (cp_finish_decl): Handle auto deduction from ().
1009 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
1010 with dependent type that is known to be a pointer.
1011
1012 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
1013
1014 PR c++/38089
1015 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
1016 specializations in an invalid namespace.
1017
1018 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
1019
1020 * error.c (print_instantiation_partial_context): Print column
1021 numbers.
1022
1023 2009-05-29 Ian Lance Taylor <iant@google.com>
1024
1025 * error.c (cp_printer): Don't use va_arg with enum type.
1026
1027 2009-05-28 Dodji Seketeli <dodji@redhat.com>
1028
1029 PR c++/39754
1030 * cp-tree.h (canonical_type_variant): Remove this function declaration.
1031 (strip_typedefs): New function declaration.
1032 * tree.c (strip_typedefs): New function definition.
1033 (canonical_type_variant): Remove function definition.
1034 * cvt.c (convert_from_reference): No need to use
1035 canonical_type_variant.
1036 * typeck.c (cp_build_indirect_ref): Likewise.
1037 * error.c (dump_template_bindings): Use strip_typedefs instead of
1038 canonical_type_variant.
1039 * pt.c (convert_template_argument, unify): Likewise.
1040 * mangle.c (canonicalize_for_substitution): Don't use
1041 canonical_type_variant.
1042
1043 2009-05-27 Jason Merrill <jason@redhat.com>
1044
1045 * call.c (implicit_conversion): Handle conversion from
1046 initializer-list to scalar.
1047 (convert_like_real): Likewise. Avoid crashing on list
1048 initialization with bad conversions.
1049 (can_convert): Use LOOKUP_EXPLICIT.
1050 (can_convert_arg_bad): Add flags parm.
1051 * cp-tree.h: Adjust.
1052 * typeck.c (convert_for_assignment): Pass flags.
1053
1054 2009-05-27 Ian Lance Taylor <iant@google.com>
1055
1056 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
1057 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
1058
1059 2009-05-26 Ian Lance Taylor <iant@google.com>
1060
1061 * Make-lang.in (g++spec.o): Use $(COMPILER).
1062 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
1063 (cc1plus$(exeext)): Likewise.
1064
1065 2009-05-26 Dodji Seketeli <dodji@redhat.com>
1066
1067 PR c++/40007
1068 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
1069 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
1070 (get_types_needing_access_check): Declare new entry point.
1071 * pt.c (append_type_to_template_for_access_check_1,
1072 get_types_needing_access_check): New functions.
1073 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
1074 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
1075 get_types_needing_access_check, no more
1076 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1077 (instantiate_class_template): Set input_location to the source
1078 location of the most specialized template definition.
1079 Perform access check using the RECORD_TYPE of the template, not its
1080 associated most generic TEMPLATE_DECL.
1081 (append_type_to_template_for_access_check): Augment function
1082 comments. Use the new get_types_needing_access_check, not
1083 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1084 append_type_to_template_for_access_check_1 subroutine.
1085
1086 2009-05-22 Jason Merrill <jason@redhat.com>
1087
1088 PR c++/38064
1089 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1090 arithmetic comparisons.
1091 (cp_common_type): Handle scoped enums.
1092
1093 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1094 (add_builtin_candidate, add_builtin_candidates): Likewise.
1095 (convert_like_real): Likewise.
1096 * class.c (check_bitfield_decl): Likewise.
1097 * decl.c (check_static_variable_definition): Likewise.
1098 (compute_array_index_type): Likewise.
1099 * decl2.c (grokbitfield): Likewise.
1100 * init.c (build_new_1): Likewise.
1101 * pt.c (convert_nontype_argument): Likewise.
1102 (current_instantiation): Likewise.
1103 * tree.c (pod_type_p): Likewise.
1104 * typeck.c (build_static_cast_1): Likewise.
1105 (build_reinterpret_cast_1): Likewise.
1106
1107 2009-05-22 Richard Guenther <rguenther@suse.de>
1108
1109 PR middle-end/38964
1110 * init.c (avoid_placement_new_aliasing): Remove.
1111 (build_new_1): Do not call it.
1112
1113 2009-05-22 Mark Mitchell <mark@codesourcery.com>
1114
1115 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1116 * semantics.c (expand_or_defer_fn): Similarly.
1117
1118 2009-05-20 Ian Lance Taylor <iant@google.com>
1119
1120 * parser.c (cp_parser_postfix_expression): Change args to a vec.
1121 Release it when done.
1122 (tree_vector): Define typedef. Define VEC functions.
1123 (cp_parser_parenthesized_expression_list): Change return type to
1124 vec. Change all callers.
1125 (cp_parser_new_expression): Change placement and initializer to
1126 vecs. Release them when done.
1127 (cp_parser_new_placement): Change return type to vec. Change all
1128 callers.
1129 (cp_parser_new_initializer): Likewise.
1130 * typeck.c (build_function_call_vec): Just call
1131 cp_build_function_call_vec.
1132 (cp_build_function_call): Just build a vec and call
1133 cp_build_function_call_vec.
1134 (cp_build_function_call_vec): New function based on old
1135 cp_build_function_call.
1136 (convert_arguments): Remove nargs and argarray parameters. Change
1137 values to a vec. Change caller.
1138 (build_x_compound_expr_from_vec): New function.
1139 (cp_build_modify_expr): Build vec to pass to
1140 build_special_member_call.
1141 * call.c (struct z_candidate): Add first_arg field. Change args
1142 field to vec.
1143 (convert_class_to_reference): Handle first argument separately.
1144 (add_candidate): Add first_arg parameter. Change args parameter
1145 to vec. Change all callers.
1146 (add_function_candidate, add_conv_candidate): Likewise.
1147 (add_template_candidate_real, add_template_candidate): Likewise.
1148 (add_template_conv_candidate): Likewise.
1149 (build_user_type_conversion_1): Handle first argument separately.
1150 (resolve_args): Change return type and parameter type to vecs.
1151 Change all callers.
1152 (perform_overload_resolution): Change args parameter to vec.
1153 Change all callers.
1154 (build_new_function_call, build_operator_new_call): Likewise.
1155 (add_candidates): Likewise.
1156 (build_op_call): New globally visible function, built from and
1157 replacing static function build_object_call.
1158 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
1159 of arguments.
1160 (build_op_delete_call): Build vec to pass to
1161 cp_build_function_call_vec.
1162 (build_temp): Build vec to pass to build_special_member_call.
1163 (convert_like_real): Likewise.
1164 (perform_direct_initialization_if_possible): Likewise.
1165 (build_over_call): Handle first_arg field. Use build_call_array
1166 rather than build_call_list.
1167 (build_special_member_call): Change args parameter to vec. Change
1168 all callers.
1169 (build_new_method_call): Likewise.
1170 * init.c (expand_default_init): Change parms to vec.
1171 (build_raw_new_expr): Change placement and init to vecs. Change
1172 all callers.
1173 (build_new_1, build_new): Likewise.
1174 * class.c (resolve_address_of_overloaded_function): Build array to
1175 pass to fn_type_unification.
1176 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1177 build_new. For CALL_EXPR create a vec rather than a tree_list;
1178 expand a pack if necessary.
1179 (fn_type_unification): Change args parameter to const tree *. Add
1180 nargs parameter. Change all callers.
1181 (type_unification_real): Likewise.
1182 (unify): Build array to pass to type_unification_real.
1183 (get_bindings): Build array to pass to fn_type_unification.
1184 (any_type_dependent_arguments_p): Change args parameter to a vec.
1185 Change all callers.
1186 (make_args_non_dependent): Renamed from build_non_dependent_args.
1187 Change return type to void. Change parameter type to vec. Change
1188 all callers.
1189 (do_auto_deduction): Pass an array to type_unification_real.
1190 * semantics.c (perform_koenig_lookup): Change args to vec. Change
1191 all callers.
1192 (finish_call_expr): Change args to vec. Change all callers. Call
1193 build_op_call instead of passing CALL_EXPR to build_new_op.
1194 (cxx_omp_create_clause_info): Allocate vec to pass to
1195 build_special_member_call.
1196 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
1197 to vec. Change all callers.
1198 * name-lookup.c (lookup_function_nonclass): Likewise.
1199 (struct arg_lookup): Change args to vec.
1200 (arg_assoc_namespace): Handle args as a vec.
1201 (arg_assoc_args_vec): New static function.
1202 (lookup_arg_dependent): Change args parameter to vec. Change all
1203 callers.
1204 * method.c (do_build_assign_ref): Allocate vec to pass to
1205 build_special_member_call.
1206 * except.c (build_throw): Likewise.
1207 * typeck2.c (build_functional_cast): Likewise.
1208 * cvt.c (ocp_convert): Likewise.
1209 * tree.c (build_min_non_dep_call_vec): Change last parameter to
1210 vec. Change all callers.
1211 * cp-tree.h: Update declarations.
1212 * name-lookup.h: Update declarations.
1213
1214 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
1215
1216 * typeck.c (default_conversion): Check targetm.promoted_type.
1217 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
1218 (grokparms): Check targetm.invalid_parameter_type.
1219 * cvt.c (ocp_convert): Check targetm.convert_to_type.
1220 (build_expr_type_conversion): Check targetm.promoted_type.
1221
1222 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
1223
1224 * typeck.c (build_binary_op): Allow % on integal vectors.
1225
1226 2009-05-18 Jason Merrill <jason@redhat.com>
1227
1228 Implement explicit conversions ops as specified in N2437.
1229 * decl.c (grokdeclarator): Handle explicit conversion ops.
1230 (check_initializer): Pass flags to store_init_value.
1231 * decl2.c (maybe_emit_vtables): Likewise.
1232 * init.c (expand_aggr_init_1): Likewise.
1233 * call.c (convert_class_to_reference): Take flags parm,
1234 check DECL_NONCONVERTING_P.
1235 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
1236 (add_builtin_candidates): Simplify getting type of conversion.
1237 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
1238 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
1239 (reference_binding): Take flags parm. Direct-initialize copy parm.
1240 (add_function_candidate): Direct-initialize the copy parm.
1241 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
1242 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
1243 (conditional_conversion): Likewise.
1244 (convert_like_real): Only complain about DECL_NONCONVERTING_P
1245 constructors.
1246 (perform_implicit_conversion_flags): Add flags parm to
1247 perform_implicit_conversion. Improve diagnostics.
1248 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
1249 (LOOKUP_COPY_PARM): New bit macro.
1250 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
1251 * typeck.c (convert_for_assignment): Take flags parm, pass it to
1252 perform_implicit_conversion_flags.
1253 (cp_build_modify_expr): Pass flags to convert_for_assignment.
1254 (convert_for_initialization): Likewise.
1255 * typeck2.c (store_init_value): Take flags parm, pass to
1256 digest_init_flags.
1257 (digest_init_flags): Add flags parm to digest_init.
1258 (digest_init_r): Take flags parm, pass to convert_for_initialization.
1259 (process_init_constructor_array): Pass it.
1260 (process_init_constructor_record): Likewise.
1261 (process_init_constructor_union): Likewise.
1262
1263 2009-05-16 Jason Merrill <jason@redhat.com>
1264
1265 PR c++/40139
1266 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
1267 with a dependent type. Actually look up the destructor.
1268 * semantics.c (finish_id_expression): Fix logic.
1269 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
1270 a function.
1271 * typeck.c (build_x_unary_op): Diagnose taking the address of a
1272 constructor or destructor.
1273 * tree.c (get_first_fn): Handle OFFSET_REF.
1274
1275 2009-05-17 Joseph Myers <joseph@codesourcery.com>
1276
1277 * tree.c (cxx_printable_name_internal): Allow consecutive
1278 translated and untranslated cached copies of the name of the
1279 current function.
1280
1281 2009-05-15 Ian Lance Taylor <iant@google.com>
1282
1283 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1284 cp_lvalue_kind. Change all uses.
1285 (enum base_access_flags): Rename from enum base_access. Change
1286 all uses.
1287 * parser.c (enum cp_parser_flags): Remove enum tag.
1288
1289 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
1290
1291 PR 16302
1292 * call.c (build_new_op): Update calls to warn_logical_operator.
1293
1294 2009-05-14 Ian Lance Taylor <iant@google.com>
1295
1296 * class.c (layout_class_type): Change itk to unsigned int.
1297 * decl.c (finish_enum): Change itk to unsigned int.
1298 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
1299 casts.
1300
1301 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
1302
1303 * decl.c (duplicate_decls): Preserve parameter attributes.
1304
1305 2009-05-10 Jan Hubicka <jh@suse.cz>
1306
1307 * decl2.c (cxx_callgraph_analyze_expr): Use
1308 cgraph_mark_address_taken.
1309
1310 2009-05-10 Joseph Myers <joseph@codesourcery.com>
1311
1312 * call.c (name_as_c_string): Call type_as_string_translate.
1313 Translate identifiers to locale character set.
1314 * cp-tree.h (lang_decl_name): Update prototype.
1315 (type_as_string_translate, decl_as_string_translate,
1316 cxx_printable_name_translate): Declare.
1317 * cxx-pretty-print.c (M_): Define.
1318 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
1319 English fragments for conditional translation with M_.
1320 * decl.c (grokdeclarator): Translate identifiers to locale
1321 character set for diagnostics.
1322 * error.c (M_): Define.
1323 (dump_template_bindings, dump_type, dump_aggr_type,
1324 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
1325 dump_function_decl, dump_template_parms, dump_expr,
1326 dump_binary_op, op_to_string, assop_to_string): Mark English
1327 fragments for conditional translation with M_.
1328 (type_as_string): Disable translation of identifiers.
1329 (type_as_string_translate): New.
1330 (expr_as_string): Disable translation of identifiers.
1331 (decl_as_string): Disable translation of identifiers.
1332 (decl_as_string_translate): New.
1333 (lang_decl_name): Add parameter translate.
1334 (args_to_string): Call type_as_string_translate.
1335 (cp_print_error_function): Call cxx_printable_name_translate.
1336 (print_instantiation_full_context,
1337 print_instantiation_partial_context): Call
1338 decl_as_string_translate.
1339 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
1340 identifier in diagnostic.
1341 * tree.c (cxx_printable_name): Change to
1342 cxx_printable_name_internal. Add parameter translate.
1343 (cxx_printable_name, cxx_printable_name_translate): New wrappers
1344 round cxx_printable_name_internal.
1345
1346 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
1347
1348 PR c/36892
1349 * call.c (build_call_a): Updated warn_deprecated_use call.
1350 (build_over_call): Likewise.
1351 * decl.c (grokdeclarator): Likewise.
1352 (grokparms): Likewise.
1353 * semantics.c (finish_id_expression): Likewise.
1354 * typeck.c (build_class_member_access_expr): Likewise.
1355 (finish_class_member_access_expr): Likewise.
1356
1357 2009-05-06 Dodji Seketeli <dodji@redhat.com>
1358
1359 PR c++/17395
1360 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
1361 whole list of PARM_DECLs, just the current one.
1362
1363 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
1364
1365 * cp-tree.h:
1366 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1367 mangle_compound_literal): Remove unused declarations.
1368 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1369 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1370 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1371 check_for_out_of_scope_variable, print_other_binding_stack,
1372 maybe_push_decl, cxx_mark_addressable, force_target_expr,
1373 build_target_expr_with_type, finish_case_label,
1374 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1375 check_template_keyword, cxx_omp_predetermined_sharing,
1376 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1377 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1378 cxx_omp_privatize_by_reference): Rearrange the declarations line to
1379 match the comment that indicates the .c file which the functions are
1380 defined.
1381 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1382 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1383
1384 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
1385
1386 * typeck.c (cp_build_compound_expr): Require RHS to have a known
1387 type.
1388 * class.c (resolve_address_of_overloaded_function): Use
1389 OVL_CURRENT for error message.
1390 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1391 with them. Do not copy the node.
1392
1393 2009-05-05 Jakub Jelinek <jakub@redhat.com>
1394
1395 PR c++/40013
1396 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1397 set it from its operand's type after tsubst_expr.
1398
1399 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1400
1401 PR c++/28152
1402 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
1403 canonical spelling for keywords.
1404 (cp_parser_attribute_list): Use the canonical spelling for
1405 keywords in attributes.
1406
1407 2009-05-01 Joseph Myers <joseph@codesourcery.com>
1408
1409 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1410 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1411 pp_cxx_new_expression, pp_cxx_delete_expression,
1412 pp_cxx_unary_expression, pp_cxx_assignment_operator,
1413 pp_cxx_assignment_expression, pp_cxx_expression,
1414 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1415 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1416 pp_cxx_exception_specification, pp_cxx_direct_declarator,
1417 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1418 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1419 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1420 pp_cxx_declaration, pp_cxx_typeid_expression,
1421 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1422 pp_cxx_trait_expression): Mostly use pp_string and
1423 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1424 for non-identifiers. Mark English strings for translation.
1425 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1426 * error.c (dump_template_parameter, dump_template_bindings,
1427 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1428 dump_decl, dump_template_decl, dump_function_decl,
1429 dump_parameters, dump_exception_spec, dump_template_parms,
1430 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1431 assop_to_string, args_to_string, cp_print_error_function,
1432 print_instantiation_full_context,
1433 print_instantiation_partial_context): Mostly use pp_string and
1434 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1435 for non-identifiers. Mark English strings for translation.
1436 (dump_global_iord): Mark strings for translation; use longer
1437 strings instead of substituting single words.
1438 (function_category): Return a format string marked for
1439 translation, not a single word or phrase to substitute in a longer
1440 phrase.
1441
1442 2009-04-28 Ben Elliston <bje@au.ibm.com>
1443
1444 PR c++/35652
1445 Revert:
1446
1447 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1448
1449 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1450
1451 2009-04-27 Ian Lance Taylor <iant@google.com>
1452
1453 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1454 omp_clause_code.
1455
1456 2009-04-27 Jakub Jelinek <jakub@redhat.com>
1457
1458 PR c++/39875
1459 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1460 -Wunused-value if implicit.
1461
1462 2009-04-24 Ian Lance Taylor <iant@google.com>
1463
1464 * call.c (build_temp): Change 0 to enum constant.
1465 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1466 type.
1467 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1468 * decl2.c (constrain_visibility): Likewise.
1469 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1470 (cp_parser_flags): Typedef to int rather than enum type.
1471 (cp_parser_expression_stack_entry): Change prec field to enum
1472 cp_parser_prec.
1473
1474 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1475 Change all callers.
1476
1477 2009-04-22 Dodji Seketeli <dodji@redhat.com>
1478
1479 PR c++/39639
1480 * parser.c (cp_parser_template_argument_list): Display an error
1481 when an ellipsis is not preceded by a parameter pack. Also, warn
1482 about variadic templates usage without -std=c++0x.
1483
1484 2009-04-21 Taras Glek <tglek@mozilla.com>
1485
1486 * cp-tree.h: Update GTY annotations to new syntax.
1487 * decl.c: Likewise.
1488 * mangle.c: Likewise.
1489 * name-lookup.c: Likewise.
1490 * name-lookup.h: Likewise.
1491 * parser.c: Likewise.
1492 * pt.c: Likewise.
1493 * rtti.c: Likewise.
1494 * semantics.c: Likewise.
1495 * typeck2.c: Likewise.
1496
1497 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1498
1499 PR c++/14875
1500 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
1501
1502 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1503
1504 PR c++/35711
1505 * typeck.c (check_for_casting_away_constness): We diagnose casting
1506 away any qualifiers not just constness.
1507 (casts_away_constness): Mention that it handles more than just
1508 constness.
1509
1510 2009-04-21 Joseph Myers <joseph@codesourcery.com>
1511
1512 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
1513 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
1514 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
1515 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1516 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
1517 cfns.gperf: Add copyright and license notices.
1518 * cfns.h: Regenerate.
1519 * ChangeLog, ChangeLog-2004: Correct dates.
1520
1521 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1522
1523 PR 16202
1524 * tree.c (lvalue_p_1): Use const_tree.
1525 Use CONST_CAST_TREE to avoid warning.
1526 (lvalue_p): Returns bool, receives const_tree.
1527
1528 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1529
1530 PR c++/13358
1531 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
1532 * error.c (pedwarn_cxx98): New.
1533 * cp-tree.h (pedwarn_cxx98): Declare.
1534
1535 2009-04-20 Le-Chun Wu <lcwu@google.com>
1536
1537 PR c++/39803
1538 * init.c (build_vec_init): Set TREE_NO_WARNING on the
1539 compiler-generated INDIRECT_REF expression.
1540
1541 2009-04-20 Ian Lance Taylor <iant@google.com>
1542
1543 * typeck.c (build_function_call_vec): New function.
1544 (cp_build_function_call): Only pass first parameter to
1545 objc_rewrite_function_call.
1546 (build_modify_expr): Add rhs_origtype parameter. Change all
1547 callers.
1548 * decl.c (finish_decl): Add origtype parameter. Change all
1549 callers.
1550 * semantics.c (finish_call_expr): Pass VEC to
1551 resolve_overloaded_builtin.
1552
1553 2009-04-20 Ian Lance Taylor <iant@google.com>
1554
1555 * cp-tree.h (base_access): Change typedef to int.
1556 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
1557 (cp_parser_omp_threadprivate): Likewise.
1558 * pt.c (unify_pack_expansion): Add casts to enum type.
1559
1560 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
1561
1562 PR c/32061
1563 PR c++/36954
1564 * call.c (build_new_op): Save the original codes of operands
1565 before folding.
1566
1567 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
1568
1569 * cp-tree.h: Remove the prototype for insert_block.
1570 * decl.c (insert_block): Remove.
1571
1572 2009-04-16 Ian Lance Taylor <iant@google.com>
1573
1574 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
1575 (tsubst_flags_t): Change typedef from enum type to int.
1576
1577 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
1578
1579 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
1580 instead of targetm.vector_opaque_p.
1581
1582 2009-04-15 Le-Chun Wu <lcwu@google.com>
1583
1584 PR c++/39551
1585 * call.c (build_over_call): Set TREE_NO_WARNING on the
1586 compiler-generated INDIRECT_REF expression.
1587 * cvt.c (convert_to_void): Emit warning when stripping off
1588 INDIRECT_REF.
1589
1590 2009-04-14 Diego Novillo <dnovillo@google.com>
1591
1592 * parser.c (cp_parser_type_specifier_seq): Move call to
1593 invoke_plugin_callbacks ...
1594 (cp_parser_type_specifier_seq): ... here.
1595
1596 2009-04-14 Le-Chun Wu <lcwu@google.com>
1597
1598 * Make-lang.in: Modify dependencies of files including plugin.h.
1599 * decl.c (finish_function): Call invoke_plugin_callbacks.
1600 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
1601
1602 2009-04-14 Jason Merrill <jason@redhat.com>
1603
1604 PR c++/39763
1605 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
1606 about shadowing by tentative parms.
1607
1608 2009-04-13 Jason Merrill <jason@redhat.com>
1609
1610 PR c++/39480
1611 * call.c (build_over_call): Don't call memcpy if the target is
1612 the same as the source.
1613
1614 2009-04-13 Jason Merrill <jason@redhat.com>
1615
1616 PR c++/39750
1617 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
1618
1619 2009-04-12 Jason Merrill <jason@redhat.com>
1620
1621 PR c++/39742
1622 * call.c (joust): Don't crash on variadic fn.
1623
1624 2009-04-10 Jason Merrill <jason@redhat.com>
1625
1626 PR c++/28301
1627 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
1628 if we see a close brace without an open brace.
1629
1630 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
1631
1632 * parser.c (cp_parser_class_specifier): Remove the unused
1633 has_trailing_semicolon.
1634
1635 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
1636
1637 PR c++/20118
1638 * parser.c (cp_parser_check_template_parameters): Take a
1639 cp_declarator parameter.
1640 (cp_parser_elaborated_type_specifier): Update to
1641 cp_parser_check_template_parameters.
1642 (cp_parser_class_head): Likewise.
1643 (cp_parser_check_declarator_template_parameters): Likewise.
1644 (cp_parser_check_template_parameters): Handle first the non-error
1645 conditions. Give more accurate diagnostics if a declarator is
1646 given.
1647
1648 2009-04-08 Jason Merrill <jason@redhat.com>
1649
1650 PR c++/25185
1651 * error.c (dump_aggr_type): Chase template typedefs if
1652 -fno-pretty-templates.
1653
1654 2009-04-08 Dodji Seketeli <dodji@redhat.com>
1655
1656 PR c++/39637
1657 * parser.c (cp_parser_enumerator_definition): Make sure the
1658 initializer of the enumerator doesn't contain any bare parameter pack.
1659
1660 2009-04-07 Jason Merrill <jason@redhat.com>
1661
1662 PR c++/34691
1663 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
1664 * call.c (joust): Complain about mismatched default arguments
1665 in extern "C" functions.
1666 * class.c (resolve_address_of_overloaded_function): Handle multiple
1667 extern "C" functions.
1668 * pt.c (resolve_overloaded_unification): Likewise.
1669
1670 2009-04-07 Jason Merrill <jason@redhat.com>
1671
1672 PR c++/25185
1673 * error.c (dump_function_decl): Don't pretty-print templates
1674 if -fno-pretty-templates.
1675 (count_non_default_template_args): Print all args if
1676 -fno-pretty-templates.
1677
1678 2009-04-06 Jason Merrill <jason@redhat.com>
1679
1680 PR c++/35146
1681 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
1682 the deduced template arguments give us the parameter types
1683 we're looking for.
1684
1685 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
1686 Jason Merrill <jason@redhat.com>
1687
1688 PR c++/14912
1689 * error.c (count_non_default_template_args): New fn.
1690 (dump_template_parms): Call it.
1691 (dump_template_argument_list): Call it. Add parms parm.
1692 (dump_template_argument): Adjust call to dump_template_argument_list.
1693 (dump_type, dump_decl): Likewise.
1694 (dump_template_bindings): Refactor logic.
1695
1696 2009-04-03 Jason Merrill <jason@redhat.com>
1697
1698 PR c++/25185
1699 * error.c (dump_template_bindings): Look through typedefs in
1700 typename results.
1701 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
1702 (find_typenames_r): Also collect typedefs.
1703 * pt.c (unify): Strip typedefs.
1704
1705 PR c++/39608
1706 * semantics.c (finish_id_expression): Don't assume a dependent
1707 member of the current instantiation isn't a valid integral
1708 constant expression. Check dependent_scope_p.
1709 * pt.c (dependent_scope_p): Check TYPE_P.
1710 (tsubst_copy): If args is null, just return.
1711
1712 2009-04-02 Jason Merrill <jason@redhat.com>
1713
1714 PR c++/25185
1715 * error.c (find_typenames, find_typenames_r): New fns.
1716 (dump_function_decl): Call find_typenames.
1717 (dump_template_bindings): Print typenames as well.
1718 * pt.c (tsubst): Non-static.
1719 * cp-tree.h: Declare it.
1720
1721 2009-04-02 Dodji Seketeli <dodji@redhat.com>
1722
1723 PR c++/26693
1724 * decl2.c (grokfield): when a typedef appears in a
1725 class, create the typedef variant type node for it.
1726 (save_template_attributes): Creating typedef variant type node
1727 here is now useless.
1728 * decl.c (grokdeclarator): If the typedef'ed struct/class was
1729 anonymous, set the proper type name to all its type variants.
1730 (xref_basetypes) : Fixup the variant types after setting
1731 TYPE_BINFO on REF.
1732 * name-lookup.c (pushdecl_maybe_friend): Reuse the
1733 set_underlying_type function to install typedef variant types.
1734 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
1735 macro.
1736 (append_type_to_template_for_access_check): New entry points.
1737 * semantics.c (check_accessibility_of_qualified_id):
1738 When a typedef that is a member of a class appears in a template,
1739 add it to the template. It will be ...
1740 * class.c (finish_struct_bits): Split type variant fixup into ...
1741 (fixup_type_variants): A new entry point.
1742 * pt.c (instantiate_class_template, instantiate_template ): ... access
1743 checked at template instantiation time.
1744 (resolve_type_name_type): The type name should be the name of the
1745 main type variant.
1746 (retrieve_specialization): Specializations of template typedefs aren't
1747 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
1748 (append_type_to_template_for_access_check): New entry point.
1749 (tsubst_decl): For typedefs, build the variant type from the correct
1750 original type.
1751 (get_class_bindings): Fix function comment.
1752 (perform_typedefs_access_check): New entry point.
1753
1754 2009-03-31 Jason Merrill <jason@redhat.com>
1755
1756 PR c++/34691
1757 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
1758 extern "C" declarations.
1759
1760 C++ DR 613
1761 * semantics.c (finish_non_static_data_member): Allow such references
1762 without an associated object in sizeof/decltype/alignof.
1763
1764 * ptree.c (cxx_print_decl): Pretty-print full name of
1765 function/template.
1766 (cxx_print_type): Pretty-print full name of class.
1767
1768 * decl.c (grokdeclarator): Reject pointer to qualified function
1769 type.
1770
1771 PR c++/37806, core issue 547
1772 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
1773 to a typedef.
1774 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
1775 function type.
1776 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
1777 * decl.c (groktypename): Add is_template_arg parameter.
1778 (grokdeclarator): Allow function cv-quals on a template type arg.
1779 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
1780 is_template_arg argument in calls to groktypename.
1781 * cp-tree.h: Adjust prototype.
1782 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
1783 FUNCTION_TYPE printing.
1784
1785 * mangle.c (write_expression): Mangle dependent name as
1786 source-name.
1787
1788 PR c++/38030, 38850, 39070
1789 * pt.c (type_dependent_expression_p_push): New fn.
1790 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
1791 substitution makes the call non-dependent. Preserve koenig_p.
1792 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
1793 for non-dependent calls.
1794 * semantics.c (finish_call_expr): Revert earlier changes.
1795 * cp-tree.h: Revert change to finish_call_expr prototype.
1796
1797 2009-03-29 Joseph Myers <joseph@codesourcery.com>
1798
1799 PR preprocessor/34695
1800 * cp-tree.h (cp_cpp_error): Remove.
1801 * error.c (cp_cpp_error): Remove.
1802 * parser.c (cp_lexer_new_main): Set done_lexing instead of
1803 client_diagnostic and error callback.
1804
1805 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
1806
1807 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
1808 * cp/cp-objcp-common.c (cxx_staticp): Remove.
1809 * cp/cp-tree.h (cxx_staticp): Remove.
1810
1811 2009-03-28 Jakub Jelinek <jakub@redhat.com>
1812
1813 PR c++/39554
1814 * parser.c (cp_parser_postfix_expression): Don't call
1815 warning_if_disallowed_function_p.
1816
1817 2009-03-27 Jan Hubicka <jh@suse.cz>
1818
1819 * except.c (choose_personality_routine): Set terminate_node to abort
1820 for java exceptions.
1821
1822 2009-03-27 Dodji Seketeli <dodji@redhat.com>
1823 Jakub Jelinek <jakub@redhat.com>
1824
1825 PR debug/37959
1826 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
1827 (cp_function_decl_explicit_p): New prototype.
1828 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
1829
1830 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
1831
1832 PR c++/38638
1833 * parser.c (cp_parser_elaborated_type_specifier): If we have a
1834 typename tag and don't have either a TYPE_DECL or a
1835 TEMPLATE_ID_EXPR, set the type to NULL.
1836
1837 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1838
1839 PR c++/37647
1840 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
1841 scope.
1842
1843 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
1844
1845 PR c++/29727
1846 * decl.c (check_array_designated_initializer): Handle error_mark_node.
1847
1848 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1849
1850 PR c++/35652
1851 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1852
1853 2009-03-26 Andrew Haley <aph@redhat.com>
1854
1855 PR C++/39380
1856 * decl2.c (possibly_inlined_p): If java exceptions are in use
1857 don't inline a decl unless it is explicitly marked inline.
1858 * lex.c: (pragma_java_exceptions): New variable.
1859 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
1860 * cp-tree.h (pragma_java_exceptions): Declare new variable.
1861
1862 2009-03-24 Jason Merrill <jason@redhat.com>
1863
1864 PR c++/28274
1865 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
1866
1867 2009-03-23 Jakub Jelinek <jakub@redhat.com>
1868
1869 PR c/39495
1870 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
1871 code if iter is the second operand.
1872 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
1873 argument. If it is set, don't build the toplevel expression with
1874 build_x_binary_op, but build2.
1875 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
1876 callers.
1877 (cp_parser_omp_for_cond): Don't assume the first operand of the
1878 comparison must be decl.
1879
1880 2009-03-23 Jason Merrill <jason@redhat.com>
1881
1882 PR c++/37729
1883 * pt.c (make_fnparm_pack): Split out from...
1884 (instantiate_decl): ...here.
1885 (tsubst_pack_expansion): Handle being called in a late-specified
1886 return type.
1887
1888 PR c++/39526
1889 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
1890 a parm with a parm.
1891
1892 2009-03-20 Jason Merrill <jason@redhat.com>
1893
1894 PR c++/28879
1895 * parser.c (cp_parser_direct_declarator): In a template, wrap
1896 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
1897 * pt.c (tsubst): Preserve it in a partial instantiation.
1898 (dependent_type_p_r): Don't check value_dependent_expression_p.
1899 * decl.c (compute_array_index_type): Don't check
1900 value_dependent_expression_p if TREE_SIDE_EFFECTS.
1901
1902 C++ core issue 703
1903 * typeck2.c (check_narrowing): Don't complain about loss of
1904 precision when converting a floating-point constant.
1905
1906 2009-03-19 Jakub Jelinek <jakub@redhat.com>
1907
1908 PR c/39495
1909 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
1910 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
1911
1912 2009-03-18 Jakub Jelinek <jakub@redhat.com>
1913
1914 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
1915 (eof_token): Adjust.
1916
1917 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
1918
1919 PR c++/39425
1920 * parser.c (cp_parser_explicit_specialization): Don't skip the
1921 rest of the specialization when begin_specialization returns
1922 false.
1923
1924 2009-03-17 Jason Merrill <jason@redhat.com>
1925
1926 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
1927 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
1928 * pt.c (check_explicit_specialization): Likewise.
1929 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
1930 local specialization.
1931 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
1932 * decl2.c (parm_index): New fn.
1933 * semantics.c (finish_decltype_type): Don't use describable_type.
1934 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
1935 Give a sorry for unsupported codes rather than crash. Mangle
1936 conversions with other than 1 operand. New mangling for PARM_DECL.
1937 * operators.def (ALIGNOF_EXPR): Mangle as "az".
1938
1939 2009-03-17 Jing Yu <jingyu@google.com>
1940
1941 PR middle-end/39378
1942 * method.c (use_thunk): Change is_thunk from crtl to cfun.
1943
1944 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
1945
1946 PR c++/39475
1947 * semantics.c (check_trait_type): New.
1948 (finish_trait_expr): Use it.
1949
1950 2009-03-17 Jakub Jelinek <jakub@redhat.com>
1951
1952 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
1953 instead of calling imported_module_or_decl debug hook if
1954 building_stmt_tree ().
1955 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
1956 is a NAMESPACE_DECL.
1957
1958 PR debug/37890
1959 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
1960 hook at function scope.
1961
1962 PR debug/39471
1963 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
1964 on IMPORTED_DECL.
1965
1966 2009-03-09 Jakub Jelinek <jakub@redhat.com>
1967
1968 PR c++/39371
1969 * semantics.c (finish_switch_cond): Don't call get_unwidened.
1970 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
1971 instead of TREE_TYPE (cond).
1972
1973 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
1974
1975 PR c++/39060
1976 * parser.c (cp_parser_late_parsing_default_args): Continue
1977 the loop when cp_parser_assignment_expression returns
1978 error_mark_node.
1979
1980 2009-03-07 Jason Merrill <jason@redhat.com>
1981
1982 PR c++/39367
1983 * init.c (build_new_1): Don't use a VLA type.
1984 (build_vec_init): Handle getting a pointer for BASE.
1985
1986 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
1987
1988 PR c++/37520
1989 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
1990 when mangling symbols.
1991
1992 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
1993
1994 PR c++/33492
1995 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
1996
1997 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
1998
1999 * decl.c (record_builtin_java_type): Use canonicalized integer
2000 types.
2001
2002 2009-03-04 Jason Merrill <jason@redhat.com>
2003
2004 PR c++/38908
2005 * class.c (is_really_empty_class): New fn.
2006 * cp-tree.h: Declare it.
2007 * cp-objcp-common.c (cp_expr_size): Use it.
2008
2009 PR c++/13549
2010 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
2011 * parser.c (cp_parser_postfix_expression): Call it for
2012 TEMPLATE_ID_EXPR.
2013 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
2014 (get_first_fn): Likewise.
2015
2016 PR c++/9634
2017 PR c++/29469
2018 PR c++/29607
2019 Implement DR 224.
2020 * decl.c (make_typename_type): Do look inside currently open classes.
2021 * parser.c (cp_parser_lookup_name): Likewise.
2022 (cp_parser_template_name): Likewise.
2023 * pt.c (dependent_scope_p): New function.
2024 * cp-tree.h: Declare it.
2025 * class.c (currently_open_class): Return fast if T isn't a class.
2026
2027 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
2028
2029 PR c++/37789
2030 * parser.c (cp_parser_mem_initializer): Return error_mark_node
2031 if cp_parser_mem_initializer_id returns error_mark_node.
2032
2033 2009-02-24 Richard Guenther <rguenther@suse.de>
2034
2035 PR c++/39242
2036 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
2037 declared functions.
2038
2039 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
2040
2041 PR c++/36411
2042 * pt.c (coerce_template_template_parms): Return 0 if parameter
2043 is error_mark_node.
2044
2045 2009-02-23 Jason Merrill <jason@redhat.com>
2046
2047 * pt.c (unify): Call maybe_adjust_types_for_deduction when
2048 deducing from an initializer list.
2049
2050 2009-02-20 Jason Merrill <jason@redhat.com>
2051
2052 PR c++/39225
2053 * decl.c (grokdeclarator): Handle ~identifier.
2054
2055 2009-02-19 Jakub Jelinek <jakub@redhat.com>
2056
2057 PR target/39175
2058 * decl2.c (determine_visibility): If visibility changed and
2059 DECL_RTL has been already set, call make_decl_rtl to update symbol
2060 flags.
2061
2062 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
2063
2064 PR c++/39188
2065 * cp-tree.h (maybe_commonize_var): New.
2066
2067 * decl.c (maybe_commonize_var): Make it extern.
2068
2069 * decl2.c (finish_anon_union): Call maybe_commonize_var.
2070
2071 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
2072
2073 PR c++/39219
2074 * parser.c (cp_parser_enum_specifier): Apply all attributes.
2075
2076 2009-02-18 Jason Merrill <jason@redhat.com>
2077
2078 * cfns.h: Tweak pathname for cfns.gperf.
2079
2080 2009-02-13 Jason Merrill <jason@redhat.com>
2081
2082 PR c++/39070
2083 * semantics.c (finish_call_expr): Change koenig_p parm to int.
2084 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2085 * cp-tree.h: Adjust prototype.
2086 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2087
2088 2009-02-12 Jason Merrill <jason@redhat.com>
2089
2090 PR c++/38950
2091 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2092
2093 2009-02-11 Jason Merrill <jason@redhat.com>
2094
2095 PR c++/39153
2096 * decl2.c (cp_write_global_declarations):
2097 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2098
2099 PR c++/30111
2100 * init.c (build_value_init_noctor): Split out from...
2101 (build_value_init): ...here.
2102 (expand_aggr_init_1): Handle value-initialization.
2103 * cp-tree.h: Add declaration.
2104 * class.c (type_has_user_provided_constructor):
2105 Handle non-class arguments.
2106
2107 2009-02-10 Jason Merrill <jason@redhat.com>
2108
2109 PR c++/38649
2110 * class.c (defaultable_fn_p): Handle ... properly.
2111
2112 PR c++/36744
2113 * tree.c (lvalue_p_1): Condition rvalue ref handling on
2114 treat_class_rvalues_as_lvalues, too.
2115
2116 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2117
2118 PR c++/34397
2119 * typeck.c (build_x_array_ref): New.
2120 * cp-tree.h: Declare it.
2121 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2122
2123 2009-02-09 Jason Merrill <jason@redhat.com>
2124
2125 PR c++/39109
2126 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2127 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2128 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2129 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2130 for build_value_init TARGET_EXPR.
2131 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2132
2133 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
2134
2135 PR c++/35147
2136 PR c++/37737
2137 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2138
2139 2009-02-04 Jakub Jelinek <jakub@redhat.com>
2140
2141 PR c++/39095
2142 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2143 remove ./dt operator.
2144 * mangle.c (write_expression): Handle COMPONENT_REF after handling
2145 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2146 write_string ("dt") instead of using operators.def.
2147
2148 2009-02-03 Jason Merrill <jason@redhat.com>
2149
2150 * typeck.c (cp_build_unary_op): Only complain about taking address
2151 of main if pedantic.
2152
2153 2009-02-03 Jakub Jelinek <jakub@redhat.com>
2154
2155 PR inline-asm/39059
2156 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2157
2158 PR c++/39056
2159 * typeck2.c (digest_init_r): Don't call process_init_constructor
2160 for COMPLEX_TYPE.
2161
2162 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
2163
2164 PR c++/36897
2165 * pt.c (convert_nontype_argument_function): Expect expr to be an
2166 ADDR_EXPR.
2167
2168 PR c++/37314
2169 * typeck.c (merge_types): Call resolve_typename_type if only
2170 one type is a typename.
2171
2172 2009-02-02 Jason Merrill <jason@redhat.com>
2173
2174 PR c++/39054
2175 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
2176 in BIT_NOT_EXPR.
2177
2178 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
2179
2180 PR c++/39053
2181 * parser.c (cp_parser_pure_specifier): If there are no tokens left
2182 do not call cp_lexer_consume_token.
2183
2184 2009-01-30 Jakub Jelinek <jakub@redhat.com>
2185
2186 PR c++/39028
2187 * parser.c (cp_parser_already_scoped_statement): Handle __label__
2188 declarations.
2189
2190 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2191
2192 PR c++/33465
2193 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
2194
2195 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2196
2197 PR c++/38655
2198 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
2199
2200 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2201
2202 * typeck.c (invalid_nonstatic_memfn_p): Use
2203 DECL_NONSTATIC_MEMBER_FUNCTION_P.
2204
2205 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
2206
2207 PR c++/37554
2208 * call.c (build_over_call): If convert_for_arg_passing returns
2209 error_mark_node unconditionally return it.
2210
2211 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
2212
2213 * class.c (check_field_decls): Also inherit packed for bitfields
2214 regardless of their type.
2215
2216 2009-01-22 Dodji Seketeli <dodji@redhat.com>
2217
2218 PR c++/38930
2219 * decl2.c (grokfield): Reverting changes of PR c++/26693
2220 (save_template_attributes): Likewise.
2221 * decl.c (grokdeclarator): Likewise.
2222 * name-lookup.c (pushdecl_maybe_friend): Likewise.
2223 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
2224 (append_type_to_template_for_access_check): Likewise.
2225 * semantics.c (check_accessibility_of_qualified_id): Likewise.
2226 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
2227 (tsubst): Likewise.
2228 (resolve_type_name_type): Likewise.
2229 (append_type_to_template_for_access_check): Likewise.
2230
2231 2009-01-21 Dodji Seketeli <dodji@redhat.com>
2232
2233 PR c++/26693
2234 * decl2.c (grokfield): when a typedef appears in a
2235 class, create the typedef variant type node for it.
2236 (save_template_attributes): Creating typedef variant type node
2237 here is now useless.
2238 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2239 anonymous, set the proper type name to all its type variants.
2240 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2241 set_underlying_type function to install typedef variant types.
2242 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2243 macro.
2244 (append_type_to_template_for_access_check): New entry points.
2245 * semantics.c (check_accessibility_of_qualified_id):
2246 When a typedef that is a member of a class appears in a template,
2247 add it to the template. It will be ...
2248 * pt.c (instantiate_class_template, instantiate_template ): ... access
2249 checked at template instantiation time.
2250 (tsubst): Handle the case of being called with NULL args.
2251 (resolve_type_name_type): The type name should be the name of the
2252 main type variant.
2253 (append_type_to_template_for_access_check): New entry point.
2254
2255 2009-01-19 Jason Merrill <jason@redhat.com>
2256
2257 PR c++/23287
2258 * parser.c (cp_parser_unqualified_id): In a template,
2259 accept ~identifier.
2260 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
2261
2262 2009-01-16 Jason Merrill <jason@redhat.com>
2263
2264 PR c++/38877
2265 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
2266 * init.c (build_new): Don't call describable_type unless we
2267 have an auto.
2268
2269 PR c++/29470
2270 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2271
2272 PR c++/38579
2273 * search.c (protected_accessible_p): N doesn't vary.
2274
2275 2009-01-15 Jason Merrill <jason@redhat.com>
2276
2277 PR c++/38850
2278 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2279 accept hidden friends.
2280
2281 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2282
2283 PR C++/29388
2284 * decl.c (grokdeclarator): Check for a non namespace/class context.
2285
2286 2009-01-15 Jason Merrill <jason@redhat.com>
2287
2288 PR c++/36334
2289 PR c++/37646
2290 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
2291 a function isn't necessarily an lvalue. Take tree, not const_tree.
2292 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2293 * typeck.c (lvalue_or_else): Likewise.
2294 * cp-tree.h: Adjust prototypes.
2295
2296 2009-01-15 Steve Ellcey <sje@cup.hp.com>
2297
2298 PR c++/38357
2299 * pt.c (tsubst): Check for NULL args.
2300
2301 2009-01-15 Dodji Seketeli <dodji@redhat.com>
2302
2303 PR c++/38636
2304 * name-lookup.c (pushtag): Don't create members to types that are not
2305 being created.
2306
2307 2009-01-14 Nick Clifton <nickc@redhat.com>
2308
2309 PR c++/37862
2310 * parser.c: Pass cp_id_kind computed in
2311 cp_parser_postfix_dot_deref_expression to
2312 cp_parser_primary_expression.
2313
2314 2009-01-13 Jakub Jelinek <jakub@redhat.com>
2315
2316 PR c++/38795
2317 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
2318 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
2319 as CAST_EXPR.
2320
2321 2009-01-12 Jason Merrill <jason@redhat.com>
2322 Steve Ellcey <sje@cup.hp.com>
2323
2324 PR c++/35109
2325 * name-lookup.c (lookup_name_real): Keep looking past a hidden
2326 binding.
2327
2328 2009-01-12 Dodji Seketeli <dodji@redhat.com>
2329
2330 PR c++/36019
2331 * pt.c (parameter_of_template_p): New function.
2332 * cp-tree.h: Declare it.
2333 * name-lookup.c (binding_to_template_parms_of_scope_p): New
2334 function.
2335 (outer_binding): Take template parameters in account when looking for
2336 a name binding.
2337
2338 2009-01-12 Jason Merrill <jason@redhat.com>
2339
2340 PR c++/31488
2341 * tree.c (pod_type_p): Return 1 for structs created by the back end.
2342
2343 2009-01-12 Jakub Jelinek <jakub@redhat.com>
2344
2345 PR c/32041
2346 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
2347 offsetof member-designator, handle it as `[0].'.
2348
2349 PR c++/38794
2350 * decl.c (start_function): If grokdeclarator hasn't returned
2351 FUNCTION_DECL nor error_mark_node, issue diagnostics.
2352
2353 2009-01-11 Jakub Jelinek <jakub@redhat.com>
2354
2355 PR c++/36254
2356 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
2357 (gimplify_if_stmt): ... this.
2358 (cp_gimplify_expr): Don't handle IF_STMT here.
2359 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
2360
2361 2009-01-10 Andrew Pinski <pinskia@gmail.com>
2362
2363 PR c++/38648
2364 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2365
2366 PR c++/36695
2367 * typeck2.c (build_functional_cast): Check for reference type and NULL
2368 PARMS.
2369
2370 2009-01-09 Steve Ellcey <sje@cup.hp.com>
2371
2372 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2373
2374 2009-01-09 Jakub Jelinek <jakub@redhat.com>
2375
2376 PR c++/35335
2377 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2378
2379 2009-01-09 John F. Carr <jfc@mit.edu>
2380
2381 PR c++/37877
2382 * parser.c (cp_parser_class_specifier): Clear
2383 parser->in_unbraced_linkage_specification_p while parsing class
2384 specifiers.
2385
2386 2009-01-07 Jakub Jelinek <jakub@redhat.com>
2387
2388 PR c++/38725
2389 * semantics.c (finish_goto_stmt): Convert destination to
2390 void *.
2391
2392 2009-01-06 Jason Merrill <jason@redhat.com>
2393
2394 PR c++/35297
2395 PR c++/35477
2396 PR c++/35784
2397 PR c++/36846
2398 PR c++/38276
2399 * pt.c (check_default_tmpl_args): Don't complain about
2400 out-of-order parameter packs in the enclosing class
2401 or parameter packs after default args.
2402 (coerce_template_parms): If we have more than one
2403 parameter pack, don't flatten argument packs.
2404 (template_args_equal): Handle argument packs.
2405 (comp_template_args): Don't flatten argument packs.
2406 (check_instantiated_arg): Split out from...
2407 (check_instantiated_args): Here. Handle arg packs.
2408 (convert_template_argument): Just check that nontype argument
2409 packs have the right type.
2410
2411 2009-01-05 Dodji Seketeli <dodji@redhat.com>
2412
2413 PR c++/38472
2414 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2415
2416 2009-01-05 Jason Merrill <jason@redhat.com>
2417
2418 PR c++/38698
2419 * typeck2.c (process_init_constructor_union): Handle union with
2420 no fields.
2421
2422 * mangle.c (write_expression): Remove mangling for zero-operand
2423 casts.
2424
2425 PR c++/38701
2426 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2427 defaulting.
2428
2429 PR c++/38702
2430 * class.c (defaultable_fn_p): Only operator== can be a copy
2431 assignment operator.
2432
2433 2009-01-02 Jason Merrill <jason@redhat.com>
2434
2435 PR c++/38698
2436 * typeck2.c (process_init_constructor_union): Handle excess
2437 initializers.
2438 (process_init_constructor_record): Likewise.
2439
2440 PR c++/38684
2441 * typeck2.c (digest_init_r): Don't use process_init_constructor
2442 for non-aggregate classes.
2443
2444 \f
2445 Copyright (C) 2009 Free Software Foundation, Inc.
2446
2447 Copying and distribution of this file, with or without modification,
2448 are permitted in any medium without royalty provided the copyright
2449 notice and this notice are preserved.