983d751570f9b67e04703e119537d92f5281091b
[gcc.git] / gcc / cp / ChangeLog
1 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
2
3 * cp-tree.h: Do not include toplev.h.
4
5 2010-07-06 Jason Merrill <jason@redhat.com>
6
7 PR c++/44703
8 * call.c (is_std_init_list): Look through typedefs.
9
10 PR c++/44778
11 * init.c (build_offset_ref): If scope isn't dependent,
12 don't exit early. Look at TYPE_MAIN_VARIANT.
13 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
14
15 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
16
17 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
18
19 * cp-tree.h (impl_conv_void): New type.
20 (convert_to_void): Adjust prototype.
21 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
22 diagnostic for easy translation. Change caller.
23 * typeck.c: Update call to convert_to_void.
24 * semantics.c: Likewise.
25 * init.c: Likewise.
26
27 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
28
29 * decl.c (cp_finish_decl): Call add_local_decl.
30 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
31
32 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
33
34 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
35 throughout.
36
37 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
38
39 PR c++/22138
40 * parser.c (cp_parser_primary_expression): Error if local template is
41 declared.
42
43 2010-07-02 Le-Chun Wu <lcwu@google.com>
44
45 PR/44128
46 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
47 (variable or type) shadows another type.
48
49 2010-07-02 Jakub Jelinek <jakub@redhat.com>
50
51 PR c++/44780
52 * typeck.c (convert_for_assignment): When converting a convertible
53 vector type or objc++ types, call mark_rvalue_use.
54 * typeck2.c (build_m_component_ref): Use return values from
55 mark_rvalue_use or mark_lvalue_use.
56 * class.c (build_base_path): Likewise.
57 * call.c (build_conditional_expr): Likewise.
58
59 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
60
61 PR c++/44039
62 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
63 returns NULL_TREE.
64
65 2010-07-01 Richard Guenther <rguenther@suse.de>
66
67 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
68 predicate we are looking for, allow non-gimplified
69 INDIRECT_REFs.
70
71 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
72
73 PR c++/44628
74 * typeck.c (cp_build_unary_op): Early return error_mark_node when
75 arg is NULL_TREE too.
76 * call.c (convert_class_to_reference): Return error_mark_node when
77 expr is NULL_TREE.
78
79 2010-06-30 Michael Matz <matz@suse.de>
80
81 * repo.c (finish_repo): Fix typo.
82
83 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
84
85 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
86
87 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
88
89 * repo.c (pending_repo): Change type to a VEC.
90 (finish_repo): Adjust for new type of pending_repo.
91 (repo_emit_p): Likewise.
92
93 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
94
95 * tree.c: Include gimple.h. Do not include tree-flow.h
96 * decl.c: Do not include tree-flow.h
97 * Make-lang.in: Adjust dependencies.
98
99 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
100
101 * decl.c (incomplete_var): Declare. Declare VECs containing them.
102 (incomplete_vars): Adjust comment. Change type to a VEC.
103 (maybe_register_incomplete_var): Adjust for new type.
104 (complete_vars): Adjust iteration over incomplete_vars.
105
106 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
107
108 * decl.c (struct named_label_entry): Change type of bad_decls field
109 to a VEC.
110 (poplevel_named_label_1): Adjust for new type of bad_decls.
111 (check_goto): Likewise.
112
113 2010-06-29 Jason Merrill <jason@redhat.com>
114
115 Enable implicitly declared move constructor/operator= (N3053).
116 * class.c (add_implicitly_declared_members): A class with no
117 explicitly declared copy or move constructor gets both declared
118 implicitly, and similarly for operator=.
119 (check_bases): A type with no copy ctor does not inhibit
120 a const copy ctor in a derived class. It does mean the derived
121 one is non-trivial.
122 (check_field_decl): Likewise.
123 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
124 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
125 (trivially_copyable_p): Likewise.
126 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
127 * class.c (finish_struct_bits): Likewise.
128 * tree.c (build_target_expr_with_type): Likewise.
129 * typeck2.c (store_init_value): Likewise.
130
131 Enable implicitly deleted functions (N2346)
132 * class.c (check_bases_and_members): Adjust lambda flags.
133 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
134
135 * decl2.c (mark_used): Adjust error for use of deleted function.
136
137 Machinery to support implicit delete/move.
138 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
139 has_complex_move_ctor, has_complex_move_assign bitfields.
140 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
141 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
142 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
143 (enum special_function_kind): Add sfk_move_assignment.
144 (LOOKUP_SPECULATIVE): New.
145 * call.c (build_over_call): Return early if it's set.
146 (build_over_call): Use trivial_fn_p.
147 * class.c (check_bases): If the base has no default constructor,
148 the derived one is non-trivial. Handle move ctor/op=.
149 (check_field_decl): Likewise.
150 (check_bases_and_members): Handle move ctor/op=.
151 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
152 (type_has_move_constructor, type_has_move_assign): New.
153 * decl.c (grok_special_member_properties): Handle move ctor/op=.
154 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
155 (trivial_fn_p): New.
156 (do_build_copy_constructor): Use it.
157 (do_build_assign_ref): Likewise. Handle move assignment.
158 (build_stub_type, build_stub_object, locate_fn_flags): New.
159 (locate_ctor): Use locate_fn_flags.
160 (locate_copy, locate_dtor): Remove.
161 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
162 (process_subob_fn, synthesized_method_walk): New.
163 (maybe_explain_implicit_delete): New.
164 (implicitly_declare_fn): Use synthesized_method_walk,
165 type_has_trivial_fn, and type_set_nontrivial_flag.
166 (defaulted_late_check): Set DECL_DELETED_FN.
167 (defaultable_fn_check): Handle sfk_move_assignment.
168 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
169 implicitly deleted move ctor/op=.
170 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
171 (lookup_fnfields_slot): New.
172 * semantics.c (omp_clause_info_fndecl): Remove.
173 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
174 get_copy_assign, trivial_fn_p.
175 (trait_expr_value): Adjust call to locate_ctor.
176 * tree.c (special_function_p): Handle sfk_move_assignment.
177
178 * class.c (type_has_virtual_destructor): New.
179 * cp-tree.h: Declare it.
180 * semantics.c (trait_expr_value): Use it.
181
182 * call.c (build_over_call): Only give warnings with tf_warning.
183
184 * name-lookup.c (pop_scope): Handle NULL_TREE.
185
186 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
187 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
188 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
189 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
190 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
191 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
192 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
193 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
194 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
195 (sfk_assignment_operator): Rename to sfk_copy_assignment.
196 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
197 * search.c, semantics.c, tree.c: Adjust.
198
199 * pt.c (dependent_scope_ref_p): Remove.
200 (value_dependent_expression_p): Don't call it.
201 (type_dependent_expression_p): Here either.
202 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
203 if the scope isn't dependent.
204
205 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
206 a reference.
207
208 PR c++/44587
209 * pt.c (has_value_dependent_address): New.
210 (value_dependent_expression_p): Check it.
211 (convert_nontype_argument): Likewise. Call decay_conversion before
212 folding if we want a pointer.
213 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
214 scope is the current instantiation.
215
216 2010-06-28 Jakub Jelinek <jakub@redhat.com>
217
218 PR c++/44682
219 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
220 on expr.
221
222 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
223
224 * init.c: Do not include except.h.
225 * decl.c: Likewise.
226 * expr.c: Likewise.
227 * cp-lang.c: Likewise.
228 * pt.c: Likewise.
229 * semantics.c: Likewise.
230 * decl2.c: Likewise.
231 * except.c: Likewise.
232 (init_exception_processing): Do not set the removed
233 lang_protect_cleanup_actions here.
234 (cp_protect_cleanup_actions): Make non-static and remove prototype.
235 (doing_eh): New, moved from except.c but removed the do_warning flag.
236 (expand_start_catch_block): Update doing_eh call.
237 (expand_end_catch_block): Likewise.
238 (build_throw): Likewise.
239 * cp-tree.h: Prototype cp_protect_cleanup_actions.
240 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
241 cp_protect_cleanup_actions.
242 * Make-lang.in: Update dependencies.
243
244 2010-06-26 Jason Merrill <jason@redhat.com>
245
246 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
247 constructor called with a single argument that takes a reference
248 to the constructor's class.
249 (BAD_CONVERSION_RANK): New.
250 (compare_ics): Use it to compare bad ICSes.
251
252 2010-06-25 Joseph Myers <joseph@codesourcery.com>
253
254 * lang-specs.h: Remove +e handling.
255
256 2010-06-24 Andi Kleen <ak@linux.intel.com>
257
258 * parser.c: (cp_parser_question_colon_clause):
259 Switch to use cp_lexer_peek_token.
260 Call warn_for_omitted_condop. Call pedwarn for omitted
261 middle operand.
262
263 2010-06-22 Jakub Jelinek <jakub@redhat.com>
264
265 PR c++/44619
266 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
267 datum and mark_rvalue_use on component.
268
269 PR c++/44627
270 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
271 the CALL_EXPR has no arguments.
272
273 2010-06-21 Jason Merrill <jason@redhat.com>
274
275 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
276
277 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
278 element type.
279
280 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
281
282 * name-lookup.c (struct arg_lookup): Convert namespaces and
283 classes fields to VEC.
284 (arg_assoc_namespace): Adjust for new type of namespaces.
285 (arg_assoc_class): Adjust for new type of classes.
286 (lookup_arg_dependent): Use make_tree_vector and
287 release_tree_vector.
288 * typeck2.c (build_x_arrow): Use vec_member.
289
290 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
291
292 PR c++/44486
293 * error.c (dump_decl): Better wording for anonymous namespace.
294
295 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
296
297 * class.c (build_vtbl_initializer): Adjust computation of new_position
298 and which entry to add padding for.
299
300 2010-06-16 Jason Merrill <jason@redhat.com>
301
302 * except.c (check_noexcept_r): Return the problematic function.
303 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
304 * pt.c (tsubst_copy_and_build): Pass it.
305 * parser.c (cp_parser_unary_expression): Likewise.
306 * cp-tree.h: Adjust prototype.
307
308 * method.c (defaulted_late_check): Give the defaulted method
309 the same exception specification as the implicit declaration.
310
311 2010-06-15 Jason Merrill <jason@redhat.com>
312
313 * class.c (add_implicitly_declared_members): Implicit assignment
314 operators can also be virtual overriders.
315 * method.c (lazily_declare_fn): Likewise.
316
317 * call.c (convert_like_real): Give "initializing argument of"
318 information for ambiguous conversion. Give source position
319 of function.
320
321 * call.c (print_z_candidates): Do print viable deleted candidates.
322 (joust): Don't choose a deleted function just because its worst
323 conversion is better than another candidate's worst.
324
325 * call.c (convert_like_real): Don't complain about
326 list-value-initialization from an explicit constructor.
327
328 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
329 DECL_SOURCE_LOCATION directly.
330
331 * class.c (type_has_user_provided_default_constructor): Use
332 sufficient_parms_p.
333
334 * call.c (is_subseq): Handle ck_aggr, ck_list.
335 (compare_ics): Treat an aggregate or ambiguous conversion to the
336 same type as involving the same function.
337
338 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
339
340 * typeck.c (convert_for_assignment): Fix comment. Change message
341 format from %d to %qP.
342 (convert_for_initialization): Fix comment.
343
344 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
345
346 * cp-tree.h (expr_list_kind): New type.
347 (impl_conv_rhs): New type.
348 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
349 prototype.
350 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
351 diagnostics for easy translation. Change caller.
352 (convert_for_initialization): Use impl_conv_rhs and change caller.
353 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
354 diagnostics for easy translation. Change caller.
355 * decl.c (bad_spec_place): New enum.
356 (bad_specifiers): Use it and emit the diagnostics for easy
357 translation. Change caller.
358 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
359
360 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
361
362 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
363 to a VEC.
364 * decl2.c (cp_write_global_declarations): Adjust for new type of
365 decl_namespace_list.
366 * name-lookup.c (current_decl_namespace): Likewise.
367 (push_decl_namespace): Likewise.
368 (pop_decl_namespace): Likewise.
369
370 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
371
372 * call.c (build_java_interface_fn_ref): Call build_function_type_list
373 instead of build_function_type.
374 * decl.c (cxx_init_decl_processing): Likewise.
375 (declare_global_var): Likewise.
376 (get_atexit_node): Likewise.
377 (expand_static_init): Likewise.
378 * decl2.c (start_objects): Likewise.
379 (start_static_storage_duration_function): Likewise.
380 * except.c (init_exception_processing): Likewise.
381 (build_exc_ptr): Likewise.
382 (build_throw): Likewise.
383 * rtti.c (throw_bad_cast): Likewise.
384 (throw_bad_typeid): Likewise.
385 (build_dynamic_cast_1): Likewise.
386
387 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
388
389 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
390 (build_op_delete_call): Likewise.
391 (build_over_call): Likewise.
392 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
393 * pt.c (process_partial_specialization): Likewise.
394 (tsubst_template_args): Likewise.
395 * semantics.c (finish_asm_stmt): Likewise.
396
397 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
398
399 * decl.c (record_key_method_defined): New, broken out of ...
400 (finish_function): ... here. Call it.
401 (start_decl): Treat aliases as definitions.
402
403 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
404
405 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
406
407 * pt.c (maybe_process_partial_specialization): Likewise.
408 (register_specialization): Likewise.
409 (add_pending_template): Likewise.
410 (lookup_template_class): Likewise.
411 (push_tinst_level): Likewise.
412
413 * parser.c (cp_lexer_new_main): Likewise.
414 (cp_lexer_new_from_tokens): Likewise.
415 (cp_token_cache_new): Likewise.
416 (cp_parser_context_new): Likewise.
417 (cp_parser_new): Likewise.
418 (cp_parser_nested_name_specifier_opt): Likewise.
419 (cp_parser_template_id): Likewise.
420
421 * name-lookup.c (binding_entry_make): Likewise.
422 (binding_table_construct): Likewise.
423 (binding_table_new): Likewise.
424 (cxx_binding_make): Likewise.
425 (pushdecl_maybe_friend): Likewise.
426 (begin_scope): Likewise.
427 (push_to_top_level): Likewise.
428
429 * lex.c (init_reswords): Likewise.
430 (retrofit_lang_decl): Likewise.
431 (cxx_dup_lang_specific_decl): Likewise.
432 (copy_lang_type): Likewise.
433 (cxx_make_type): Likewise.
434
435 * decl.c (make_label_decl): Likewise.
436 (check_goto): Likewise.
437 (start_preparsed_function): Likewise.
438 (save_function_data): Likewise.
439
440 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
441
442 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
443
444 * class.c (finish_struct_1): Likewise.
445
446 * cp-tree.h (struct lang_type): Add variable_size GTY option.
447 (struct lang_decl): Likewise.
448
449 * parser.c (cp_parser_new): Update comment to not reference
450 ggc_alloc.
451
452 2010-06-07 Jason Merrill <jason@redhat.com>
453
454 PR c++/44366
455 * error.c (dump_parameters): Mask out TFF_SCOPE.
456 (dump_simple_decl): Don't print the scope of a PARM_DECL.
457 (dump_scope): Remove no-op mask.
458
459 PR c++/44401
460 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
461
462 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
463 * init.c (build_offset_ref): Use it.
464 * pt.c (maybe_process_partial_specialization): Use it.
465 (instantiate_class_template): Use it.
466 * search.c (lookup_base): Use it.
467
468 2010-06-07 Jakub Jelinek <jakub@redhat.com>
469
470 PR c++/44444
471 * expr.c (mark_exp_read): Handle INDIRECT_REF.
472 * cvt.c (convert_to_void): Handle INDIRECT_REF like
473 handled_component_p.
474
475 PR c++/44443
476 * decl.c (initialize_local_var): If TREE_USED is set on the type,
477 set also DECL_READ_P on the decl.
478
479 2010-05-25 Dodji Seketeli <dodji@redhat.com>
480
481 PR c++/44188
482 * cp-tree.h (typedef_variant_p): Move this declaration to
483 gcc/tree.h.
484 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
485 * decl.c (grokdeclarator): Do not rename debug info of an
486 anonymous tagged type named by a typedef.
487
488 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
489
490 PR c++/44086
491 * class.c (check_field_decls): Move the call to
492 check_bitfield_decl before trying to set the
493 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
494
495 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
496
497 * typeck.c: Update include path for moved files.
498 * decl.c: Likewise.
499 * rtti.c: Likewise.
500 * cp-gimplify.c: Likewise.
501 * cp-lang.c: Likewise.
502 * pt.c: Likewise.
503 * semantics.c: Likewise.
504 * cxx-pretty-print.h: Likewise.
505 * decl2.c: Likewise.
506 * parser.c: Likewise.
507 * cp-objcp-common.c: Likewise.
508 * cp-tree.h: Likewise.
509 * name-lookup.c: Likewise.
510 * lex.c: Likewise.
511 * name-lookup.h: Likewise.
512 * config-lang.in: Update paths in gtfiles for files in c-family/.
513 * Make-lang.in: Likewise.
514
515 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
516
517 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
518 * typeck.c (build_ptrmemfunc): Likewise.
519
520 2010-06-04 Jason Merrill <jason@redhat.com>
521
522 * typeck2.c (merge_exception_specifiers): Adjust merging of
523 throw() and noexcept(true).
524
525 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
526 using an uninitialized variable.
527
528 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
529 (pp_cxx_expression): Likewise.
530
531 Implement noexcept-specification (15.4)
532 * parser.c (cp_parser_exception_specification_opt): Parse it.
533 Give -Wdeprecated warning about throw() specs.
534 * pt.c (tsubst_exception_specification): Handle it.
535 * error.c (dump_exception_spec): Handle it.
536 (dump_expr): Handle NOEXCEPT_EXPR.
537 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
538 * typeck.c (comp_except_specs): Handle compatibility rules.
539 Change exact parm to take an enum.
540 * typeck2.c (merge_exception_specifiers): Handle noexcept.
541 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
542 (type_throw_all_p, build_noexcept_spec): New fns.
543 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
544 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
545 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
546 (noexcept_true_spec, noexcept_false_spec): New macros.
547 * name-lookup.c (pushdecl_maybe_friend): Adjust.
548 * search.c (check_final_overrider): Adjust.
549 * decl.c (check_redeclaration_exception_specification): Adjust.
550 (use_eh_spec_block): Use type_throw_all_p.
551 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
552 Give operator new a noexcept-specification in C++0x mode.
553 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
554 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
555
556 Implement noexcept operator (5.3.7)
557 * cp-tree.def (NOEXCEPT_EXPR): New.
558 * except.c (check_noexcept_r, finish_noexcept_expr): New.
559 * cp-tree.h: Declare finish_noexcept_expr.
560 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
561 * pt.c (tsubst_copy_and_build): And tsubst it.
562 (type_dependent_expression_p): Handle it.
563 (value_dependent_expression_p): Handle it.
564
565 * call.c (build_conditional_expr): Never fold in unevaluated context.
566 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
567 * semantics.c (simplify_aggr_init_expr): Likewise.
568 * typeck.c (merge_types): Call merge_exception_specifiers.
569 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
570 DECL_ANTICIPATED for preferring new type.
571
572 2010-06-04 Joseph Myers <joseph@codesourcery.com>
573
574 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
575 diagnostics.
576
577 2010-06-04 Jakub Jelinek <jakub@redhat.com>
578
579 PR c++/44412
580 * typeck.c (build_class_member_access_expr): Call mark_exp_read
581 on object for static data members.
582
583 2010-06-04 Jakub Jelinek <jakub@redhat.com>
584 Jason Merrill <jason@redhat.com>
585
586 PR c++/44362
587 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
588 with the same type, call mark_lvalue_use on both.
589
590 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
591
592 * class.c (struct vtbl_init_data_s): Remove last_init field.
593 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
594 to a VEC.
595 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
596 initializers.
597 (build_vtt): Likewise.
598 (initialize_vtable): Take a VEC instead of a tree.
599 (build_vtt_inits): Change return type to void. Take a VEC **
600 instead of a tree *; accumulate results into said VEC.
601 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
602 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
603 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
604 instead of a tree.
605 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
606 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
607 into it.
608 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
609 rather than tree_cons.
610 (build_vbase_offset_vtbl_entries): Likewise.
611 (add_vcall_offset): Likewise.
612 (build_rtti_vtbl_entries): Likewise.
613 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
614 * decl.c (initialize_artificial_var): Use build_constructor instead
615 of build_constructor_from_list.
616
617 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
618
619 PR c++/44294
620 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
621 bit-field.
622
623 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
624
625 * parser.c (cp_parser_mem_initializer_list): Change error text.
626
627 2010-06-02 Jakub Jelinek <jakub@redhat.com>
628
629 * cp-objcp-common.c (shadowed_var_for_decl): Change into
630 tree_decl_map hashtab from tree_map.
631 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
632 (init_shadowed_var_for_decl): Adjust initialization.
633
634 PR c++/44361
635 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
636 instead of calling mark_exp_read only when not an assignment.
637
638 PR debug/44367
639 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
640 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
641 Set DECL_VALUE_EXPR on var.
642
643 2010-06-02 Jason Merrill <jason@redhat.com>
644
645 * error.c (dump_type): Improve typedef handling.
646
647 PR c++/9726
648 PR c++/23594
649 PR c++/44333
650 * name-lookup.c (same_entity_p): New.
651 (ambiguous_decl): Multiple declarations of the same entity
652 are not ambiguous.
653
654 2010-06-01 Jason Merrill <jason@redhat.com>
655
656 DR 990
657 * call.c (add_list_candidates): Prefer the default constructor.
658 (build_aggr_conv): Treat missing initializers like { }.
659 * typeck2.c (process_init_constructor_record): Likewise.
660 * init.c (expand_default_init): Use digest_init for
661 direct aggregate initialization, too.
662
663 * call.c (add_list_candidates): Split out...
664 (build_user_type_conversion_1): ...from here.
665 (build_new_method_call): And here.
666 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
667
668 PR c++/44358
669 * call.c (build_list_conv): Set list-initialization flags properly.
670
671 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
672
673 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
674
675 2010-06-01 Arnaud Charlet <charlet@adacore.com>
676 Matthew Gingell <gingell@adacore.com>
677
678 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
679 * decl2.c: Include langhooks.h and c-ada-spec.h.
680 (cpp_check, collect_source_refs, collect_ada_namespace,
681 collect_all_refs): New functions.
682 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
683 * lang-specs.h: Ditto.
684
685 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
686
687 * cp-tree.h (cp_build_function_call_nary): Declare.
688 * typeck.c (cp_build_function_call_nary): Define.
689 * decl.c (register_dtor_fn): Use it instead of
690 cp_build_function_call.
691 (cxx_maybe_build_cleanup): Likewise.
692 * decl2.c (generate_ctor_or_dtor_function): Likewise.
693 * except.c (do_get_exception_ptr): Likewise.
694 (do_begin_catch): Likewise.
695 (do_allocate_exception): Likewise.
696 (do_free_exception): Likewise.
697 (build_throw): Likewise. Use cp_build_function_call_vec instead
698 of cp_build_function_call.
699 (do_end_catch): Likewise.
700
701 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
702
703 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
704 (struct cp_declarator): Move id_loc field up.
705
706 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
707
708 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
709 this file is included before c-common.h. Define GCC_DIAG_STYLE
710 before including diagnostic-core.h and toplev.h.
711 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
712 * pt.c: Include cp-tree.h before c-common.h.
713
714 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
715
716 * tree.c (c_register_addr_space): Add stub.
717
718 2010-05-28 Joseph Myers <joseph@codesourcery.com>
719
720 * g++spec.c (lang_specific_driver): Use fatal_error instead of
721 fatal.
722
723 2010-05-28 Dodji Seketeli <dodji@redhat.com>
724
725 Revert fix of PR c++/44188
726 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
727 gcc/tree.h.
728 * tree.c (typedef_variant_p): Revert moving this definition to
729 gcc/tree.c.
730 * decl.c (grokdeclarator): Revert naming typedef handling.
731
732 2010-05-27 Joseph Myers <joseph@codesourcery.com>
733
734 * call.c: Include diagnostic-core.h instead of diagnostic.h.
735 * cp-lang.c: Don't include diagnostic.h
736 * name-lookup.c: Include diagnostic-core.h instead of
737 diagnostic.h.
738 (cp_emit_debug_info_for_using): Use seen_error.
739 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
740 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
741 * pt.c (iterative_hash_template_arg): Use seen_error.
742 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
743 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
744 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
745 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
746 dependencies.
747
748 2010-05-25 Dodji Seketeli <dodji@redhat.com>
749
750 PR c++/44188
751 * cp-tree.h (typedef_variant_p): Move this declaration to
752 gcc/tree.h.
753 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
754 * decl.c (grokdeclarator): Do not rename debug info of an
755 anonymous tagged type named by a typedef.
756
757 2010-05-27 Jason Merrill <jason@redhat.com>
758
759 PR c++/43555
760 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
761 anonymous VLA size.
762
763 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
764
765 PR bootstrap/44287
766 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
767 * class.c (layout_class_type): Likewise.
768 * decl.c (finish_enum): Likewise.
769 * mangle.c (write_builitin_type): Likewise.
770
771 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
772
773 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
774 explicit_int128_p.
775 * decl.c (grokdeclarator): Handle __int128.
776 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
777 (cp_parser_simple_type_specifier): Likewise.
778 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
779 * typeck.c (cp_common_type): Handle __int128.
780 * mangle.c (integer_type_codes): Add itk_int128 and
781 itk_unsigned_int128.
782
783 2010-05-26 Jason Merrill <jason@redhat.com>
784
785 PR c++/43382
786 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
787 unification.
788
789 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
790
791 * cp-lang.c: Do not include expr.h.
792
793 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
794
795 * decl.c: Do not include rtl.h
796 * semantics.c: Likewise.
797
798 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
799
800 * cp-tree.h: Do not include splay-tree.h.
801 (struct prtmem_cst): Remove unused field and false comment.
802 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
803 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
804 * init.c: Do not include rtl.h and expr.h.
805 * class.c: Do not include rtl.h. Include splay-tree.h.
806 (build_clone): Use plain NULL instead of NULL_RTX.
807 * decl.c: Do not include expr.h. Explain why rtl.h has to be
808 included. Include splay-tree.h.
809 * method.c: Do not include rtl.h and expr.h.
810 (use_thunk): Use plain NULL instead of NULL_RTX.
811 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
812 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
813 and target.h. Include splay-tree.h.
814 * expr.c: Do not include rtl.h and expr.h.
815 * pt.c: Do not include obstack.h and rtl.h.
816 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
817 (tsubst_decl): Likewise.
818 (instantiate_decl): Likewise.
819 * semantics.c: Do not include exprt.h and debug.h. Explain why
820 rtl.h has to be included.
821 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
822 * call.c: Do not include rtl.h and expr.h.
823 * search.c: Do not include obstack.h and rtl.h.
824 * friend.c: Do not include rtl.h and expr.h.
825 * Make-lang.in: Update dependencies.
826
827 2010-05-25 Jakub Jelinek <jakub@redhat.com>
828
829 PR c++/18249
830 * parser.c (non_integral_constant): Add NIC_NONE.
831 (required_token): Add RT_NONE.
832 (cp_parser_unary_expression): Initialize non_constant_p
833 to NIC_NONE.
834 (cp_parser_asm_definition): Initialize missing to RT_NONE.
835 (cp_parser_primary_expression, cp_parser_postfix_expression,
836 cp_parser_cast_expression, cp_parser_binary_expression,
837 cp_parser_functional_cast): Fix formatting.
838
839 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
840
841 PR c++/18249
842 * parser.c: Remove inclusion of dyn-string.h.
843 (non_integral_constant): New enum.
844 (name_lookup_error): New enum.
845 (required_token): New enum.
846 (cp_parser_required_error): New function.
847 (cp_parser_require): Change the type of variable token_desc to
848 required_token and use cp_parser_required_error.
849 (cp_parser_require_keyword): Likewise.
850 (cp_parser_error): Use gmsgid as parameter.
851 (cp_parser_name_lookup_error): Change the type of variable desired to
852 name_lookup_error and put the diagnostic in the full sentences. Change
853 caller.
854 (cp_parser_non_integral_constant_expression): Change the type of the
855 variable thing to non_integral_constant and put the diagnostics in
856 full sentences. Change caller.
857
858 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
859
860 PR middle-end/44100
861 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
862
863 2010-05-24 Joseph Myers <joseph@codesourcery.com>
864
865 * error.c (cp_diagnostic_starter): Update call to
866 diagnostic_build_prefix.
867 (cp_print_error_function,
868 print_instantiation_partial_context_line): Check show_column flag
869 in context.
870
871 2010-05-24 Jason Merrill <jason@redhat.com>
872
873 PR c++/41510
874 * decl.c (check_initializer): Don't wrap an init-list in a
875 TREE_LIST.
876 * init.c (build_aggr_init): Don't assume copy-initialization if
877 init has CONSTRUCTOR_IS_DIRECT_INIT.
878 * call.c (build_new_method_call): Sanity check.
879
880 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
881
882 * rtti.c (tinfo_base_init): Use build_constructor instead of
883 build_constructor_from_list. Don't cons a tree node for
884 returning.
885 (generic_initializer): Use build_constructor_single instead of
886 build_constructor_from_list.
887 (ptr_initializer): Use build_constructor instead of
888 build_constructor_from_list
889 (ptm_initializer): Likewise.
890 (class_initializer): Likewise. Take varargs instead of TRAIL.
891 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
892 build_constructor instead of build_constructor_from_list.
893
894 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
895
896 * semantics.c: Include bitmap.h.
897 * Make-lang.in: Update dependencies.
898
899 2010-05-22 Jan Hubicka <jh@suse.cz>
900
901 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
902 comdat vtables.
903 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
904
905 2010-05-21 Joseph Myers <joseph@codesourcery.com>
906
907 * cxx-pretty-print.c: Correct merge error.
908
909 2010-05-21 Joseph Myers <joseph@codesourcery.com>
910
911 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
912 (cp_print_error_function): Use diagnostic_abstract_origin macro.
913 (cp_printer): Handle %K here using percent_K_format.
914 * cxx-pretty-print.c: Include tree-pretty-print.h.
915 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
916 dependencies.
917
918 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
919
920 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
921 Clean up redundant includes.
922
923 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
924
925 PR c++/30298
926 * decl.c (xref_basetypes): Return false in case of ill-formed
927 redefinition.
928
929 2010-05-19 Jason Merrill <jason@redhat.com>
930
931 * call.c (reference_binding): Use cp_build_qualified_type_real
932 and cp_type_quals consistently.
933 (add_function_candidate): Likewise.
934 (build_conditional_expr): Likewise.
935 (convert_like_real): Likewise.
936 (type_passed_as): Likewise.
937 * class.c (add_method): Likewise.
938 (same_signature_p): Likewise.
939 (layout_class_type): Likewise.
940 * decl.c (cxx_init_decl_processing): Likewise.
941 (cp_fname_init): Likewise.
942 (grokdeclarator): Likewise.
943 * decl2.c (cp_reconstruct_complex_type): Likewise.
944 * init.c (build_new_1): Likewise.
945 * method.c (do_build_copy_constructor): Likewise.
946 (implicitly_declare_fn): Likewise.
947 * pt.c (tsubst_aggr_type): Likewise.
948 (tsubst): Likewise.
949 * rtti.c (init_rtti_processing): Likewise.
950 (build_headof): Likewise.
951 (build_dynamic_cast_1): Likewise.
952 (tinfo_base_init): Likewise.
953 (emit_support_tinfos): Likewise.
954 * semantics.c (capture_decltype): Likewise.
955 * tree.c (cv_unqualified): Likewise.
956 * typeck.c (composite_pointer_type): Likewise.
957 (string_conv_p): Likewise.
958
959 * mangle.c (write_CV_qualifiers_for_type): Tweak.
960
961 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
962 * decl.c (start_decl): Likewise.
963 * semantics.c (finish_compound_literal): Likewise.
964 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
965 (cp_type_readonly): Remove.
966 * cp-tree.h: Remove declaration.
967
968 * typeck.c (merge_types): Preserve memfn quals.
969
970 * decl.c (grokdeclarator): Don't check quals on fn type.
971 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
972 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
973
974 PR c++/44193
975 * typeck.c (type_memfn_quals): New fn.
976 (apply_memfn_quals): New fn.
977 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
978 (cp_type_readonly): Use cp_type_quals.
979 * cp-tree.h: Add declarations.
980 * tree.c (cp_build_qualified_type_real): Don't set, but do
981 preserve, quals on FUNCTION_TYPE.
982 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
983 * decl.c (build_ptrmem_type): Likewise.
984 (grokdeclarator): Likewise.
985 (static_fn_type): Likewise.
986 * decl2.c (change_return_type): Likewise.
987 (cp_reconstruct_complex_type): Likewise.
988 * pt.c (tsubst_function_type): Likewise.
989 (unify): Likewise.
990 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
991
992 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
993
994 * tree.c (build_min_non_dep_call_vec): Update comment.
995
996 2010-05-17 Jason Merrill <jason@redhat.com>
997
998 * call.c (struct z_candidate): Add explicit_targs field.
999 (add_template_candidate_real): Set it.
1000 (build_over_call): Use it to control init-list warning.
1001
1002 PR c++/44157
1003 * call.c (build_over_call): Limit init-list deduction warning to
1004 cases where the argument is actually an init-list.
1005
1006 PR c++/44158
1007 * call.c (build_over_call): Don't do bitwise copy for move ctor.
1008
1009 2010-05-17 Dodji Seketeli <dodji@redhat.com>
1010 Jason Merrill <jason@redhat.com>
1011
1012 PR c++/44108
1013 * decl.c (compute_array_index_type): Call mark_rvalue_use.
1014
1015 2010-05-15 Jason Merrill <jason@redhat.com>
1016
1017 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
1018 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
1019 TYPE_NOEXCEPT_P.
1020 (finish_eh_spec_block): Adjust.
1021
1022 2010-05-15 Jakub Jelinek <jakub@redhat.com>
1023
1024 PR c++/44148
1025 * pt.c (tsubst): Unshare template argument.
1026
1027 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
1028
1029 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
1030 * Make-lang.in: Fix dependencies accordingly.
1031
1032 2010-05-14 Jason Merrill <jason@redhat.com>
1033
1034 C++ DR 475
1035 * except.c (build_throw): Simplify, adjust for DR 475.
1036
1037 PR c++/44127
1038 * except.c (dtor_nothrow): Return nonzero for type with
1039 trivial destructor.
1040
1041 PR c++/44127
1042 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
1043 gimple_build_eh_must_not_throw.
1044
1045 2010-05-14 Martin Jambor <mjambor@suse.cz>
1046
1047 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
1048 and define.
1049
1050 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
1051
1052 * call.c (build_new_method_call): Change warning text.
1053 * typeck2.c (build_functional_cast): Change error text.
1054
1055 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
1056
1057 PR c++/30566
1058 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
1059 shadowing the outer parameter or variables by the declaration of
1060 nested function in nested structure or class. Warn the shadowing by
1061 the declaration of nested lambda expression.
1062
1063 2010-05-13 Jason Merrill <jason@redhat.com>
1064
1065 * typeck.c (cp_build_array_ref): Factor out from...
1066 (build_array_ref): ...here. Drop complain parm.
1067 (build_new_op): Adjust.
1068 * class.c (build_vtbl_ref_1): Adjust.
1069 * decl2.c (grok_array_decl): Adjust.
1070 * cp-tree.h: Adjust prototypes.
1071
1072 2010-05-13 Jan Hubicka <jh@suse.cz>
1073
1074 * decl.c (cp_finish_decl): Do not worry about used attribute.
1075
1076 2010-05-12 Jason Merrill <jason@redhat.com>
1077
1078 * typeck.c (build_array_ref): Take complain parm.
1079 * cp-tree.h: Add it to prototype.
1080 * call.c (build_new_op): Pass it.
1081 * class.c (build_vtbl_ref): Pass it.
1082 * decl2.c (grok_array_decl): Pass it.
1083
1084 PR bootstrap/44048
1085 PR target/44099
1086 * cp-tree.def (NULLPTR_TYPE): Remove.
1087 * cp-tree.h (NULLPTR_TYPE_P): New.
1088 (SCALAR_TYPE_P): Use it.
1089 (nullptr_type_node): New.
1090 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
1091 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
1092 nullptr_type_node.
1093 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
1094 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1095 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
1096 * mangle.c (write_type): Likewise.
1097 * name-lookup.c (arg_assoc_type): Likewise.
1098 * typeck.c (build_reinterpret_cast_1): Likewise.
1099 * rtti.c (typeinfo_in_lib_p): Likewise.
1100 (emit_support_tinfos): Remove local nullptr_type_node.
1101
1102 * cp-tree.h (UNKNOWN_TYPE): Remove.
1103 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
1104 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
1105 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
1106 * class.c (instantiate_type): Check unknown_type_node rather than
1107 UNKNOWN_TYPE.
1108 * name-lookup.c (maybe_push_decl): Likewise.
1109 * rtti.c (get_tinfo_decl_dynamic): Likewise.
1110 (get_typeid): Likewise.
1111 * semantics.c (finish_offsetof): Likewise.
1112
1113 PR c++/20669
1114 * call.c (add_template_candidate_real): If deduction fails, still
1115 add the template as a non-viable candidate.
1116 (equal_functions): Handle template candidates.
1117 (print_z_candidate): Likewise.
1118 (print_z_candidates): Likewise.
1119 (build_new_function_call): Likewise.
1120
1121 * cp-tree.h (LOOKUP_LIST_ONLY): New.
1122 * call.c (add_candidates): Enforce it.
1123 (build_new_method_call): Try non-list ctor if no viable list ctor.
1124 (build_user_type_conversion_1): Likewise.
1125
1126 * call.c (add_candidates): Distinguish between type(x) and
1127 x.operator type().
1128 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
1129 (build_new_method_call): Give better error for conversion op.
1130
1131 * call.c (add_candidates): Add first_arg and return_type parms.
1132 Add special constructor/conversion op handling.
1133 (convert_class_to_reference): Use it.
1134 (build_user_type_conversion_1): Likewise.
1135 (build_op_call): Likewise.
1136 (build_new_method_call): Likewise.
1137 (build_new_op): Adjust.
1138 (perform_overload_resolution): Adjust.
1139
1140 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
1141
1142 PR c++/34272
1143 PR c++/43630
1144 PR c++/34491
1145 * pt.c (process_partial_specialization): Return error_mark_node
1146 in case of unused template parameters in partial specialization.
1147
1148 2010-05-11 Jakub Jelinek <jakub@redhat.com>
1149
1150 PR c++/44062
1151 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
1152 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
1153 look at its second operand.
1154
1155 2010-05-10 Jason Merrill <jason@redhat.com>
1156
1157 PR c++/44017
1158 * semantics.c (baselink_for_fns): Revert earlier change.
1159
1160 PR c++/44045
1161 * typeck.c (cp_build_modify_expr): Complain about assignment to
1162 array from init list.
1163
1164 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
1165
1166 PR c++/43719
1167 * decl.c (check_initializer): strip array type before checking for
1168 uninitialized const or ref members.
1169
1170 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
1171
1172 PR c++/43951
1173 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
1174 error count. Emit errors only if compain is true.
1175 (build_new_1): Do not return error_mark_node if
1176 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
1177 errors. Delay the check for user-provided constructor.
1178 (perform_member_init): Adjust.
1179 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
1180 prototype.
1181
1182 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
1183 Jason Merrill <jason@redhat.com>
1184
1185 Add support for C++0x nullptr.
1186 * cp-tree.def: Add NULLPTR_TYPE.
1187 * cp-tree.h: Add nullptr_node.
1188 (cp_tree_index): Add CPTI_NULLPTR.
1189 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
1190 * call.c (null_ptr_cst_p): Handle nullptr.
1191 (standard_conversion): Likewise.
1192 (convert_arg_to_ellipsis): Likewise.
1193 * mangle.c (write_type): Likewise.
1194 * name-lookup.c (arg_assoc_type): Likewise.
1195 * parser.c (cp_parser_primary_expression): Likewise.
1196 * typeck.c (cp_build_binary_op): Likewise.
1197 (build_reinterpret_cast_1): Likewise.
1198 * error.c (dump_type): Likewise.
1199 (dump_type_prefix, dump_type_suffix): Likewise.
1200 * decl.c (cxx_init_decl_processing): Likewise.
1201 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
1202 * cvt.c (ocp_convert): Likewise.
1203 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
1204 nullptr_t tinfo in libsupc++.
1205
1206 2010-05-06 Jason Merrill <jason@redhat.com>
1207
1208 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
1209
1210 2010-04-22 Jakub Jelinek <jakub@redhat.com>
1211 Dodji Seketeli <dodji@redhat.com>
1212
1213 PR c/18624
1214 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
1215 Declare ...
1216 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
1217 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
1218 (decay_conversion, perform_integral_promotions): Call rvalue_use.
1219 (cp_build_unary_op): Call lvalue_use.
1220 * decl.c (unused_but_set_errorcount): New variable.
1221 (poplevel): Issue -Wunused-but-set-variable diagnostics.
1222 (duplicate_decls): Merge DECL_READ_P flags.
1223 (start_cleanup_fn): Set DECL_READ_P flag.
1224 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
1225 * tree.c (rvalue): Call rvalue_use.
1226 * pt.c (convert_nontype_argument): Likewise.
1227 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
1228 finish_decltype_type): Likewise.
1229 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
1230 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
1231 or rvalue_use depending on the expr.
1232 * init.c (build_new, build_delete): Likewise.
1233 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
1234
1235 2010-05-05 Jason Merrill <jason@redhat.com>
1236
1237 PR c++/43787
1238 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
1239 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
1240
1241 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1242
1243 PR c++/43028
1244 * pt.c (unify): Check each elt for error_mark_node.
1245
1246 2010-05-04 Jason Merrill <jason@redhat.com>
1247
1248 PR c++/38064
1249 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
1250
1251 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
1252
1253 PR c++/43705
1254 * call.c (build_new_method_call): Return error_mark_node if fns is
1255 NULL_TREE.
1256
1257 2010-05-03 Dodji Seketeli <dodji@redhat.com>
1258
1259 PR c++/43953
1260 * pt.c (most_specialized_class): Pretend we are processing
1261 a template decl during the call to coerce_template_parms.
1262
1263 2010-05-03 Jason Merrill <jason@redhat.com>
1264
1265 PR c++/42810
1266 PR c++/43680
1267 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
1268 from the selected underlying type unless -fstrict-enums. Set
1269 ENUM_UNDERLYING_TYPE to have the restricted range.
1270 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
1271 * class.c (check_bitfield_decl): Likewise.
1272
1273 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
1274
1275 PR c++/43951
1276 * init.c (build_new_1): Revert the accidental checkin in
1277 revision 158918.
1278
1279 2010-04-30 Jason Merrill <jason@redhat.com>
1280
1281 PR c++/43868
1282 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
1283 (pp_cxx_type_specifier_seq): ...here.
1284
1285 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
1286
1287 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
1288 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
1289
1290 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
1291
1292 PR c++/43779
1293 * typeck.c (warn_args_num): New function.
1294 (convert_arguments): Use warn_args_num to print the diagnostic
1295 messages.
1296
1297 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
1298
1299 PR c++/43890
1300 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
1301 user-provided constructor while recursing.
1302
1303 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
1304
1305 PR c++/9335
1306 * error.c (print_instantiation_partial_context_line): Handle
1307 recursive instantiation.
1308 (print_instantiation_partial_context): Likewise.
1309
1310 2010-04-27 Jason Merrill <jason@redhat.com>
1311
1312 * init.c (perform_member_init): Check CLASS_TYPE_P.
1313
1314 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1315
1316 PR c++/29043
1317 * init.c (perform_member_init): check for uninitialized const or
1318 reference members, including array types.
1319
1320 2010-04-24 Jason Merrill <jason@redhat.com>
1321
1322 * tree.c (get_fns): Split out from get_first_fn.
1323 * cp-tree.h: Declare it.
1324 * search.c (shared_member_p): Use it.
1325 * semantics.c (finish_qualified_id_expr): Simplify.
1326 (finish_id_expression): Simplify.
1327
1328 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
1329 whenever object is NULL_TREE. Don't do 'this' capture here.
1330 (finish_qualified_id_expr): Pass NULL_TREE.
1331 (finish_id_expression): Likewise.
1332 (lambda_expr_this_capture): Likewise.
1333
1334 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
1335 rather than checking current_class_ref directly.
1336 (finish_call_expr): Likewise.
1337
1338 PR c++/43856
1339 * name-lookup.c (qualify_lookup): Disqualify lambda op().
1340 * class.c (current_nonlambda_class_type): New fn.
1341 * semantics.c (nonlambda_method_basetype): New.
1342 * cp-tree.h: Declare them.
1343 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
1344
1345 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
1346
1347 PR c++/43875
1348 * semantics.c (lambda_return_type): Complain about
1349 braced-init-list.
1350
1351 PR c++/43790
1352 * tree.c (cv_unqualified): Handle error_mark_node.
1353
1354 PR c++/41468
1355 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
1356 if we don't want errors.
1357
1358 PR c++/41468
1359 * class.c (convert_to_base): Add complain parameter. Pass
1360 ba_quiet to lookup_base if we don't want errors.
1361 (build_vfield_ref): Pass complain to convert_to_base.
1362 * call.c (convert_like_real): Likewise.
1363 (initialize_reference): Likewise.
1364 (perform_direct_initialization_if_possible): Pass complain to
1365 convert_like_real.
1366 * cp-tree.h: Adjust.
1367
1368 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1369 Jason Merrill <jason@redhat.com>
1370
1371 PR c++/42844
1372 * decl.c (check_for_uninitialized_const_var): Handle classes that need
1373 constructing, too.
1374 (check_initializer): Call it for classes that need constructing, too.
1375 * class.c (in_class_defaulted_default_constructor): New.
1376 * cp-tree.h: Declare it.
1377
1378 2010-04-20 Jason Merrill <jason@redhat.com>
1379
1380 PR c++/9335
1381 * init.c (constant_value_1): Treat error_mark_node as a constant
1382 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
1383 * cvt.c (ocp_convert): Handle getting error_mark_node from
1384 integral_constant_value.
1385 * decl.c (compute_array_index_type): Likewise.
1386
1387 2010-04-20 Dodji Seketeli <dodji@redhat.com>
1388
1389 PR c++/43800
1390 PR c++/43704
1391 * typeck.c (incompatible_dependent_types_p): If one of the
1392 compared types if not a typedef then honour their main variant
1393 equivalence.
1394
1395 2010-04-20 Jakub Jelinek <jakub@redhat.com>
1396
1397 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
1398
1399 2010-04-19 Dodji Seketeli <dodji@redhat.com>
1400
1401 PR c++/43704
1402 * typeck.c (structural_comptypes): Test dependent typedefs
1403 incompatibility before testing for their main variant based
1404 equivalence.
1405
1406 2010-04-19 Jakub Jelinek <jakub@redhat.com>
1407
1408 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
1409 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
1410
1411 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
1412
1413 * decl.c (cxx_init_decl_processing): Remove second argument in call to
1414 build_common_tree_nodes.
1415
1416 2010-04-14 Jason Merrill <jason@redhat.com>
1417
1418 PR c++/36625
1419 * parser.c (cp_parser_parenthesized_expression_list): Change
1420 is_attribute_list parm to int to indicate whether or not to
1421 handle initial identifier specially.
1422 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
1423
1424 2010-04-13 Jason Merrill <jason@redhat.com>
1425
1426 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
1427 CLASS_TYPE_P.
1428 * parser.c (cp_parser_lambda_expression): Complain about lambda in
1429 unevaluated context.
1430 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
1431
1432 2010-04-12 Jason Merrill <jason@redhat.com>
1433
1434 PR c++/43641
1435 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
1436 return value directly.
1437
1438 * call.c (type_decays_to): Call cv_unqualified for non-class type.
1439
1440 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
1441
1442 PR c++/25811
1443 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
1444 * init.c (build_new_1): Check for uninitialized const members and
1445 uninitialized reference members, when using new without
1446 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
1447 (diagnose_uninitialized_cst_or_ref_member): Define, call
1448 diagnose_uninitialized_cst_or_ref_member_1.
1449 (diagnose_uninitialized_cst_or_ref_member_1): New function.
1450
1451 2010-04-12 Richard Guenther <rguenther@suse.de>
1452
1453 PR c++/43611
1454 * semantics.c (expand_or_defer_fn_1): Do not keep extern
1455 template inline functions.
1456
1457 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1458
1459 PR c++/28584
1460 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
1461 pointer type.
1462
1463 2010-04-07 Jason Merrill <jason@redhat.com>
1464
1465 PR c++/43016
1466 * decl.c (start_preparsed_function): Do defer nested functions.
1467
1468 PR c++/11094, DR 408
1469 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
1470 * decl2.c (finish_static_data_member_decl): Set it.
1471 * decl.c (duplicate_decls): Propagate it.
1472 * pt.c (tsubst_decl): Don't substitute the domain of an array
1473 VAR_DECL if it's set.
1474 (regenerate_decl_from_template): Substitute it here.
1475 (type_dependent_expression_p): Return true if it's set.
1476 * semantics.c (finish_decltype_type): Instantiate such a variable.
1477 * typeck.c (cxx_sizeof_expr): Likewise.
1478 (strip_array_domain): New.
1479
1480 PR c++/43145
1481 * name-lookup.c (current_decl_namespace): Non-static.
1482 (pop_nested_namespace): Sanity check.
1483 * cp-tree.h: Declare current_decl_namespace.
1484 * decl.c (grokvardecl): Use it instead of current_namespace.
1485 (grokfndecl): Likewise.
1486
1487 PR c++/38392
1488 * pt.c (tsubst_friend_function): Instatiate a friend that has already
1489 been used.
1490
1491 * pt.c (print_template_statistics): New.
1492 * cp-tree.h: Declare it.
1493 * tree.c (cxx_print_statistics): Call it.
1494
1495 PR c++/41970
1496 * decl.c (grokvardecl): Tweak warning message.
1497 (grokfndecl): Likewise.
1498
1499 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1500
1501 PR c++/42697
1502 *pt.c (tsubst_decl): Get the arguments of a specialization from
1503 the specialization template, not from the most general template.
1504
1505 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1506
1507 PR c++/40239
1508 * typeck2.c (process_init_constructor_record):
1509 value-initialize members that are are not explicitely
1510 initialized.
1511
1512 2010-04-07 Jie Zhang <jie@codesourcery.com>
1513
1514 PR c++/42556
1515 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
1516 when all of its elements are non-constant and have been split out.
1517
1518 2010-04-06 Taras Glek <taras@mozilla.com>
1519 Jason Merrill <jason@redhat.com>
1520
1521 * parser.c (cp_parser_class_specifier): Set class location to that
1522 of IDENTIFIER_NODE instead of '{' when possible.
1523 * semantics.c (begin_class_definition): Do not overide locations
1524 with less precise ones.
1525
1526 2010-04-06 Jason Merrill <jason@redhat.com>
1527
1528 PR c++/43648
1529 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
1530
1531 PR c++/43621
1532 * pt.c (maybe_update_decl_type): Check the return value from
1533 push_scope.
1534
1535 2010-04-01 Jason Merrill <jason@redhat.com>
1536
1537 * decl.c (next_initializable_field): No longer static.
1538 * cp-tree.h: Declare it.
1539 * call.c (build_aggr_conv): Fail if there are more initializers
1540 than initializable fields.
1541
1542 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
1543 instead of void_zero_node.
1544
1545 2010-03-31 Dodji Seketeli <dodji@redhat.com>
1546
1547 PR c++/43558
1548 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
1549 * pt.c (end_template_parm_list): Store sibling template parms of
1550 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1551 (push_template_decl_real): Don't store the containing template decl
1552 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
1553 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
1554 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1555 Simplify the logic.
1556
1557 2010-03-30 Jason Merrill <jason@redhat.com>
1558
1559 PR c++/43076
1560 * pt.c (push_template_decl_real): Deal better with running out of
1561 scopes before running out of template parms.
1562
1563 PR c++/41185
1564 PR c++/41786
1565 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
1566 function parameter context. Don't print an error if parsing
1567 tentatively.
1568
1569 PR c++/43559
1570 * pt.c (more_specialized_fn): Don't control cv-qualifier check
1571 with same_type_p.
1572
1573 2010-03-26 Jason Merrill <jason@redhat.com>
1574
1575 PR c++/43509
1576 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
1577 c++0x mode, but not other type-names.
1578
1579 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1580
1581 PR c++/43327
1582 * pt.c (add_to_template_args): Support NULL ARGS;
1583 (most_specialized_class): call coerce_template_parms on
1584 template arguments passed to get_class_bindings. Use
1585 add_to_template_args.
1586 (unify): Handle VAR_DECLs.
1587
1588 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1589
1590 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
1591 into int.
1592 * pt.c (get_template_parms_at_level): Adjust.
1593
1594 2010-03-25 Dodji Seketeli <dodji@redhat.com>
1595
1596 PR c++/43206
1597 * cp-tree.h (get_template_parms_at_level): Declare ...
1598 * pt.c (get_template_parms_at_level): ... new function.
1599 * typeck.c (get_template_parms_of_dependent_type): If a template
1600 type parm's DECL_CONTEXT isn't yet set, get its siblings from
1601 current_template_parms. Use get_template_parms_at_level. Remove
1602 useless test.
1603 (incompatible_dependent_types_p): If we get empty parms from just one
1604 of the template type parms we are comparing then the template parms are
1605 incompatible.
1606
1607 2010-03-24 Jason Merrill <jason@redhat.com>
1608
1609 PR c++/43502
1610 * parser.c (make_declarator): Initialize id_loc.
1611 (cp_parser_lambda_declarator_opt): And set it.
1612
1613 2010-03-23 Jason Merrill <jason@redhat.com>
1614
1615 Make lambda conversion op and op() non-static.
1616 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
1617 Also add the thunk function returned by the conversion op.
1618 Mark the conversion deleted if the op() is variadic.
1619 * decl2.c (mark_used): Give helpful message about deleted conversion.
1620 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
1621 * semantics.c (finish_this_expr): Adjust.
1622 * mangle.c (write_closure_type_name): Adjust.
1623 * decl.c (grok_op_properties): Don't allow it.
1624 * call.c (build_user_type_conversion_1): No static conversion ops.
1625 (build_op_call): Or op().
1626
1627 * decl2.c (change_return_type): Fix 'this' quals.
1628
1629 2010-03-22 Jason Merrill <jason@redhat.com>
1630
1631 PR c++/43333
1632 * tree.c (pod_type_p): Use old meaning in C++98 mode.
1633
1634 PR c++/43281
1635 * pt.c (contains_auto_r): New fn.
1636 (do_auto_deduction): Use it.
1637 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
1638
1639 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
1640
1641 PR c++/43081:
1642 * decl2.c (grokfield): Handle invalid initializers for member
1643 functions.
1644
1645 2010-03-20 Dodji Seketeli <dodji@redhat.com>
1646
1647 PR c++/43375
1648 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
1649 is NULL.
1650 * decl2.c (vague_linkage_p): Likewise.
1651
1652 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1653
1654 PR c++/43418
1655 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
1656 false, in the cp_parser_expression_statement call.
1657
1658 2010-03-05 Jason Merrill <jason@redhat.com>
1659
1660 * mangle.c (mangle_decl): Give name collision error even without
1661 ASM_OUTPUT_DEF.
1662
1663 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
1664
1665 * pt.c (process_partial_specialization): Use error_n instead of
1666 error.
1667
1668 2010-03-03 Jason Merrill <jason@redhat.com>
1669
1670 PR c++/12909
1671 * mangle.c (mangle_decl): Handle VAR_DECL, too.
1672
1673 2010-03-03 Jason Merrill <jason@redhat.com>
1674
1675 PR c++/12909
1676 * mangle.c: Include cgraph.h.
1677 (mangle_decl): If the mangled name will change in a later
1678 ABI version, make the later mangled name an alias.
1679 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
1680 * Make-lang.in (mangle.o): Depend on cgraph.h.
1681 * method.c (make_alias_for): Handle VAR_DECL, too.
1682 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
1683 * tree.c (no_linkage_check): Adjust.
1684 * decl.c (maybe_commonize_var): Adjust.
1685 * cp-tree.h: Adjust.
1686
1687 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
1688
1689 * pt.c (redeclare_class_template): Use error_n and inform_n.
1690
1691 2010-02-27 Mark Mitchell <mark@codesourcery.com>
1692
1693 PR c++/42748
1694 * cp-tree.h (push_tinst_level): Declare.
1695 (pop_tinst_level): Likewise.
1696 * pt.c (push_tinst_level): Give it external linkage.
1697 (pop_tinst_level): Likewise.
1698 * mangle.c (mangle_decl_string): Set the source location to that
1699 of the decl while mangling.
1700
1701 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
1702
1703 PR c++/42054
1704 * pt.c (redeclare_class_template): Return false if there are erroneous
1705 template parameters.
1706
1707 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
1708
1709 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
1710 -ftemplate-depth=.
1711
1712 2010-02-24 Jason Merrill <jason@redhat.com>
1713
1714 PR c++/12909
1715 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
1716
1717 * class.c (layout_class_type): Don't give -Wabi warning for a bug
1718 in a previous ABI version.
1719
1720 2010-02-23 Jason Merrill <jason@redhat.com>
1721
1722 PR c++/43143
1723 * typeck2.c (digest_init_r): Accept value init of array.
1724
1725 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1726
1727 PR c++/43126
1728 * typeck.c (convert_arguments): Update error message.
1729
1730 2010-02-22 Mike Stump <mikestump@comcast.net>
1731
1732 PR c++/43125
1733 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
1734
1735 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1736
1737 PR c++/23510
1738 * error.c (print_instantiation_partial_context_line): New.
1739 (print_instantiation_partial_context): Print at most 12 contexts,
1740 skip the rest with a message.
1741
1742 2010-02-21 Dodji Seketeli <dodji@redhat.com>
1743
1744 PR c++/42824
1745 * pt.c (lookup_template_class): Better support of specialization
1746 of member of class template implicit instantiation.
1747
1748 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
1749
1750 PR c++/35669
1751 * call.c (conversion_null_warnings): Replace -Wconversion with
1752 -Wconversion-null.
1753 * cvt.c (build_expr_type_conversion): Likewise.
1754
1755 2010-02-18 Jason Merrill <jason@redhat.com>
1756
1757 PR c++/42837
1758 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
1759
1760 PR c++/43108
1761 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
1762 C build_binary_op.
1763 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
1764 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
1765
1766 PR c++/43070
1767 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
1768
1769 PR c++/26261
1770 PR c++/43101
1771 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
1772 (maybe_update_decl_type): New fn.
1773 * parser.c (cp_parser_init_declarator): Use it.
1774
1775 PR c++/43109
1776 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
1777
1778 2010-02-17 Jason Merrill <jason@redhat.com>
1779
1780 PR c++/43075
1781 * call.c (build_over_call): Don't create zero-sized assignments.
1782 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
1783 * cp-objcp-common.c (cp_expr_size): Remove.
1784 * cp-tree.h: Remove prototype.
1785
1786 PR c++/43069
1787 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
1788 decl we looked up doesn't match.
1789
1790 PR c++/43093
1791 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
1792 have an INIT_EXPR anymore.
1793
1794 PR c++/43079
1795 * pt.c (convert_nontype_argument): Change assert to test.
1796
1797 2010-02-16 Jason Merrill <jason@redhat.com>
1798
1799 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
1800
1801 PR c++/43031
1802 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
1803 VIEW_CONVERT_EXPR for conversions between structural equality types
1804 that the back end can't tell are the same.
1805
1806 PR c++/43036
1807 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
1808 cv-quals from element here.
1809 (cp_build_qualified_type_real): Not here. Preserve typedef name.
1810
1811 2010-02-14 Jason Merrill <jason@redhat.com>
1812
1813 PR c++/41997
1814 * semantics.c (finish_compound_literal): Use
1815 cp_apply_type_quals_to_decl when creating a static variable.
1816
1817 2010-02-12 Jason Merrill <jason@redhat.com>
1818
1819 PR c++/43024
1820 * name-lookup.h (current_binding_level): Check for null
1821 cp_function_chain.
1822
1823 2010-02-12 Jason Merrill <jason@redhat.com>
1824
1825 PR c++/43054
1826 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
1827
1828 2010-02-12 Jakub Jelinek <jakub@redhat.com>
1829
1830 PR c++/43033
1831 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
1832 instead of x.
1833
1834 2010-02-10 Jason Merrill <jason@redhat.com>
1835
1836 PR c++/41896
1837 * semantics.c (outer_lambda_capture_p): Revert.
1838 (add_capture): Only finish_member_declaration if
1839 we're in the lambda class.
1840 (register_capture_members): New.
1841 * cp-tree.h: Declare it.
1842 * parser.c (cp_parser_lambda_expression): Call it.
1843
1844 2010-02-10 Jason Merrill <jason@redhat.com>
1845
1846 PR c++/41896
1847 * semantics.c (outer_lambda_capture_p): Use current_function_decl
1848 instead of current_class_type.
1849
1850 2010-02-10 Jason Merrill <jason@redhat.com>
1851
1852 PR c++/42983, core issue 906
1853 * method.c (defaultable_fn_check): Check virtualness.
1854
1855 2010-02-10 Jason Merrill <jason@redhat.com>
1856
1857 PR c++/43016
1858 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
1859
1860 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
1861
1862 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
1863 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
1864 translation.
1865 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
1866 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
1867 (cp_parser_parameter_declaration)
1868 (cp_parser_exception_specification_opt)
1869 (cp_parser_exception_declaration): Likewise.
1870 * pt.c (check_default_tmpl_args): Likewise.
1871 * search.c (lookup_field_r): Likewise.
1872
1873 2010-02-09 Jason Merrill <jason@redhat.com>
1874
1875 PR c++/42399
1876 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
1877
1878 2010-02-09 Jason Merrill <jason@redhat.com>
1879
1880 PR c++/42370
1881 * decl2.c (change_return_type): New fn.
1882 * semantics.c (apply_lambda_return_type): Use it.
1883 * cp-tree.h: Declare it.
1884
1885 2010-02-05 Richard Guenther <rguenther@suse.de>
1886
1887 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
1888 * cp-lang.c: Include gt-cp-cp-lang.h.
1889 * config-lang.in (gtfiles): Add cp/cp-lang.c.
1890
1891 2010-02-05 Dodji Seketeli <dodji@redhat.com>
1892
1893 PR c++/42915
1894 * typeck.c (get_template_parms_of_dependent_type): Try getting
1895 the template parameters fromt the type itself first.
1896
1897 2010-02-03 Jason Merrill <jason@redhat.com>
1898
1899 PR c++/4926
1900 PR c++/38600
1901 * mangle.c (write_unqualified_id): Split out from write_expression.
1902 (write_unqualified_name): Call it.
1903 (write_member_name): Likewise.
1904 (write_expression): Support TEMPLATE_ID_EXPR.
1905 Disambiguate operator names.
1906
1907 PR c++/12909
1908 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
1909 -fabi-version=4.
1910
1911 2010-02-02 Jason Merrill <jason@redhat.com>
1912
1913 PR c++/41090
1914 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
1915 * optimize.c (clone_body): Remap their initializers when making base
1916 variants.
1917 (maybe_clone_body): Complain if multiple clones aren't safe.
1918
1919 2010-01-29 Dodji Seketeli <dodji@redhat.com>
1920
1921 PR c++/42758
1922 PR c++/42634
1923 PR c++/42336
1924 PR c++/42797
1925 PR c++/42880
1926 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1927 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1928 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
1929 * pt.c (coerce_template_parms, type_unification_real,
1930 expand_template_argument_pack, coerce_template_parameter_pack):
1931 Set the non default template args count.
1932 (current_template_args): Always set non defaulted
1933 template args count when compiled with --enable-checking
1934 (tsubst_template_args, type_unification_real): Propagate the non
1935 defaulted template args count.
1936 * error.c (get_non_default_template_args_count): Renamed
1937 count_non_default_template_args into this. Don't calculate the
1938 non default template argument count anymore. Use the new
1939 accessor macros above to get it.
1940 (dump_template_argument_list, dump_type, dump_decl,
1941 dump_template_parms): Adjust.
1942 * parser.c (cp_parser_template_argument_list): Always set defaulted
1943 template args count when compiled with --enable-checking.
1944
1945 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
1946
1947 * decl.c (redeclaration_error_message): Wrap the return messages into
1948 G_() for easy translation.
1949
1950 2010-01-28 Jason Merrill <jason@redhat.com>
1951
1952 PR c++/42880
1953 * semantics.c (begin_class_definition): Don't use type_as_string.
1954
1955 2010-01-28 Dodji Seketeli <dodji@redhat.com>
1956
1957 PR c++/42713
1958 PR c++/42820
1959 * typeck.c (get_template_parms_of_dependent_type): Factorized
1960 this out of incompatible_template_type_parms_p
1961 (incompatible_dependent_types_p): Renamed
1962 incompatible_template_type_parms_p into this. Make it detect
1963 two incompatible dependent typedefs too.
1964 (structural_comptypes): Use incompatible_dependent_types_p.
1965 * pt.c (get_template_info):
1966 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
1967
1968 2010-01-20 Janis Johnson <janis187@us.ibm.com>
1969 Jason Merrill <jason@redhat.com>
1970
1971 * mangle.c (write_type): Mangle transparent record as member type.
1972 * semantics.c (begin_class_definition): Recognize decimal classes
1973 and set TYPE_TRANSPARENT_AGGR.
1974
1975 2010-01-20 Jason Merrill <jason@redhat.com>
1976
1977 PR c++/42338
1978 * mangle.c (write_expression): Handle tree codes that have extra
1979 arguments in the middle-end.
1980
1981 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
1982
1983 PR c++/42038
1984 * except.c (expand_start_catch_block): Deal correctly with
1985 do_begin_catch returning error_mark_node.
1986
1987 2010-01-20 Jason Merrill <jason@redhat.com>
1988
1989 PR c++/41788
1990 * class.c (layout_class_type): Set packed_maybe_necessary for packed
1991 non-PODs.
1992
1993 PR c++/41920
1994 * semantics.c (build_lambda_object): Call mark_used on captured
1995 variables.
1996
1997 PR c++/40750
1998 * decl.c (grokdeclarator): Clear type_quals for a member function
1999 declared using a typedef. Don't complain about adding cv-quals
2000 to a function typedef in C++0x mode.
2001
2002 2010-01-20 Jakub Jelinek <jakub@redhat.com>
2003
2004 * decl.c (create_array_type_for_decl): Remove set but not used
2005 variable error_msg. Remove break stmts after return stmts.
2006
2007 2010-01-19 Dodji Seketeli <dodji@redhat.com>
2008
2009 * error.c (dump_template_parms, count_non_default_template_args):
2010 Revert fix of PR c++/42634.
2011
2012 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2013
2014 PR c++/42634
2015 * error.c (dump_template_parms): Use innermost template
2016 arguments before calling count_non_default_template_args.
2017 (count_non_default_template_args): We are being called with
2018 template innermost arguments now. There is no need to ensure
2019 that again.
2020
2021 2010-01-18 Dodji Seketeli <dodji@redhat.com>
2022
2023 PR c++/42766
2024 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
2025
2026 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2027
2028 PR c++/42697
2029 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
2030
2031 2010-01-17 Dodji Seketeli <dodji@redhat.com>
2032
2033 PR c++/42697
2034 *pt.c (tsubst_decl): Get the arguments of a specialization from
2035 the specialization template, not from the most general template.
2036
2037 2010-01-16 Jason Merrill <jason@redhat.com>
2038
2039 PR c++/42761
2040 * semantics.c (finish_decltype_type): Within a template, treat
2041 unresolved CALL_EXPR as dependent.
2042
2043 2010-01-15 Dodji Seketeli <dodji@redhat.com>
2044
2045 * error.c (dump_template_parms,count_non_default_template_args):
2046 Revert changes of PR c++/42634.
2047
2048 2010-01-14 Jakub Jelinek <jakub@redhat.com>
2049
2050 PR middle-end/42674
2051 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
2052 functions with noreturn attribute.
2053
2054 2010-01-14 Jason Merrill <jason@redhat.com>
2055
2056 PR c++/42701
2057 * call.c (build_new_method_call): Don't free the vec here.
2058
2059 PR c++/42655
2060 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
2061
2062 2010-01-13 Dodji Seketeli <dodji@redhat.com>
2063
2064 PR c++/42634
2065 * error.c (dump_template_parms): Use innermost template
2066 arguments before calling count_non_default_template_args.
2067 (count_non_default_template_args): We are being called with
2068 template innermost arguments now. There is no need to ensure
2069 that again.
2070
2071 2010-01-07 Dodji Seketeli <dodji@redhat.com>
2072
2073 c++/40155
2074 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
2075 arguments that were previously deduced.
2076
2077 2010-01-05 Jason Merrill <jason@redhat.com>
2078
2079 * pt.c (unify_pack_expansion): Handle deduction from init-list.
2080 * call.c (build_over_call): Don't complain about it.
2081
2082 2010-01-04 Jason Merrill <jason@redhat.com>
2083
2084 PR c++/42555
2085 * pt.c (tsubst_decl): Don't apply type attributes in place.
2086
2087 PR c++/42567
2088 * semantics.c (describable_type): Remove decltype comment and
2089 semantics.
2090
2091
2092 \f
2093 Copyright (C) 2010 Free Software Foundation, Inc.
2094
2095 Copying and distribution of this file, with or without modification,
2096 are permitted in any medium without royalty provided the copyright
2097 notice and this notice are preserved.
2098