1 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
4 * error.c (dump_decl): Better wording for anonymous namespace.
6 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
8 * class.c (build_vtbl_initializer): Adjust computation of new_position
9 and which entry to add padding for.
11 2010-06-16 Jason Merrill <jason@redhat.com>
13 * except.c (check_noexcept_r): Return the problematic function.
14 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
15 * pt.c (tsubst_copy_and_build): Pass it.
16 * parser.c (cp_parser_unary_expression): Likewise.
17 * cp-tree.h: Adjust prototype.
19 * method.c (defaulted_late_check): Give the defaulted method
20 the same exception specification as the implicit declaration.
22 2010-06-15 Jason Merrill <jason@redhat.com>
24 * class.c (add_implicitly_declared_members): Implicit assignment
25 operators can also be virtual overriders.
26 * method.c (lazily_declare_fn): Likewise.
28 * call.c (convert_like_real): Give "initializing argument of"
29 information for ambiguous conversion. Give source position
32 * call.c (print_z_candidates): Do print viable deleted candidates.
33 (joust): Don't choose a deleted function just because its worst
34 conversion is better than another candidate's worst.
36 * call.c (convert_like_real): Don't complain about
37 list-value-initialization from an explicit constructor.
39 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
40 DECL_SOURCE_LOCATION directly.
42 * class.c (type_has_user_provided_default_constructor): Use
45 * call.c (is_subseq): Handle ck_aggr, ck_list.
46 (compare_ics): Treat an aggregate or ambiguous conversion to the
47 same type as involving the same function.
49 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
51 * typeck.c (convert_for_assignment): Fix comment. Change message
52 format from %d to %qP.
53 (convert_for_initialization): Fix comment.
55 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
57 * cp-tree.h (expr_list_kind): New type.
58 (impl_conv_rhs): New type.
59 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
61 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
62 diagnostics for easy translation. Change caller.
63 (convert_for_initialization): Use impl_conv_rhs and change caller.
64 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
65 diagnostics for easy translation. Change caller.
66 * decl.c (bad_spec_place): New enum.
67 (bad_specifiers): Use it and emit the diagnostics for easy
68 translation. Change caller.
69 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
71 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
73 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
75 * decl2.c (cp_write_global_declarations): Adjust for new type of
77 * name-lookup.c (current_decl_namespace): Likewise.
78 (push_decl_namespace): Likewise.
79 (pop_decl_namespace): Likewise.
81 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
83 * call.c (build_java_interface_fn_ref): Call build_function_type_list
84 instead of build_function_type.
85 * decl.c (cxx_init_decl_processing): Likewise.
86 (declare_global_var): Likewise.
87 (get_atexit_node): Likewise.
88 (expand_static_init): Likewise.
89 * decl2.c (start_objects): Likewise.
90 (start_static_storage_duration_function): Likewise.
91 * except.c (init_exception_processing): Likewise.
92 (build_exc_ptr): Likewise.
93 (build_throw): Likewise.
94 * rtti.c (throw_bad_cast): Likewise.
95 (throw_bad_typeid): Likewise.
96 (build_dynamic_cast_1): Likewise.
98 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
100 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
101 (build_op_delete_call): Likewise.
102 (build_over_call): Likewise.
103 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
104 * pt.c (process_partial_specialization): Likewise.
105 (tsubst_template_args): Likewise.
106 * semantics.c (finish_asm_stmt): Likewise.
108 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
110 * decl.c (record_key_method_defined): New, broken out of ...
111 (finish_function): ... here. Call it.
112 (start_decl): Treat aliases as definitions.
114 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
116 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
118 * pt.c (maybe_process_partial_specialization): Likewise.
119 (register_specialization): Likewise.
120 (add_pending_template): Likewise.
121 (lookup_template_class): Likewise.
122 (push_tinst_level): Likewise.
124 * parser.c (cp_lexer_new_main): Likewise.
125 (cp_lexer_new_from_tokens): Likewise.
126 (cp_token_cache_new): Likewise.
127 (cp_parser_context_new): Likewise.
128 (cp_parser_new): Likewise.
129 (cp_parser_nested_name_specifier_opt): Likewise.
130 (cp_parser_template_id): Likewise.
132 * name-lookup.c (binding_entry_make): Likewise.
133 (binding_table_construct): Likewise.
134 (binding_table_new): Likewise.
135 (cxx_binding_make): Likewise.
136 (pushdecl_maybe_friend): Likewise.
137 (begin_scope): Likewise.
138 (push_to_top_level): Likewise.
140 * lex.c (init_reswords): Likewise.
141 (retrofit_lang_decl): Likewise.
142 (cxx_dup_lang_specific_decl): Likewise.
143 (copy_lang_type): Likewise.
144 (cxx_make_type): Likewise.
146 * decl.c (make_label_decl): Likewise.
147 (check_goto): Likewise.
148 (start_preparsed_function): Likewise.
149 (save_function_data): Likewise.
151 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
153 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
155 * class.c (finish_struct_1): Likewise.
157 * cp-tree.h (struct lang_type): Add variable_size GTY option.
158 (struct lang_decl): Likewise.
160 * parser.c (cp_parser_new): Update comment to not reference
163 2010-06-07 Jason Merrill <jason@redhat.com>
166 * error.c (dump_parameters): Mask out TFF_SCOPE.
167 (dump_simple_decl): Don't print the scope of a PARM_DECL.
168 (dump_scope): Remove no-op mask.
171 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
173 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
174 * init.c (build_offset_ref): Use it.
175 * pt.c (maybe_process_partial_specialization): Use it.
176 (instantiate_class_template): Use it.
177 * search.c (lookup_base): Use it.
179 2010-06-07 Jakub Jelinek <jakub@redhat.com>
182 * expr.c (mark_exp_read): Handle INDIRECT_REF.
183 * cvt.c (convert_to_void): Handle INDIRECT_REF like
187 * decl.c (initialize_local_var): If TREE_USED is set on the type,
188 set also DECL_READ_P on the decl.
190 2010-05-25 Dodji Seketeli <dodji@redhat.com>
193 * cp-tree.h (typedef_variant_p): Move this declaration to
195 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
196 * decl.c (grokdeclarator): Do not rename debug info of an
197 anonymous tagged type named by a typedef.
199 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
202 * class.c (check_field_decls): Move the call to
203 check_bitfield_decl before trying to set the
204 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
206 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
208 * typeck.c: Update include path for moved files.
211 * cp-gimplify.c: Likewise.
212 * cp-lang.c: Likewise.
214 * semantics.c: Likewise.
215 * cxx-pretty-print.h: Likewise.
217 * parser.c: Likewise.
218 * cp-objcp-common.c: Likewise.
219 * cp-tree.h: Likewise.
220 * name-lookup.c: Likewise.
222 * name-lookup.h: Likewise.
223 * config-lang.in: Update paths in gtfiles for files in c-family/.
224 * Make-lang.in: Likewise.
226 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
228 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
229 * typeck.c (build_ptrmemfunc): Likewise.
231 2010-06-04 Jason Merrill <jason@redhat.com>
233 * typeck2.c (merge_exception_specifiers): Adjust merging of
234 throw() and noexcept(true).
236 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
237 using an uninitialized variable.
239 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
240 (pp_cxx_expression): Likewise.
242 Implement noexcept-specification (15.4)
243 * parser.c (cp_parser_exception_specification_opt): Parse it.
244 Give -Wdeprecated warning about throw() specs.
245 * pt.c (tsubst_exception_specification): Handle it.
246 * error.c (dump_exception_spec): Handle it.
247 (dump_expr): Handle NOEXCEPT_EXPR.
248 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
249 * typeck.c (comp_except_specs): Handle compatibility rules.
250 Change exact parm to take an enum.
251 * typeck2.c (merge_exception_specifiers): Handle noexcept.
252 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
253 (type_throw_all_p, build_noexcept_spec): New fns.
254 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
255 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
256 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
257 (noexcept_true_spec, noexcept_false_spec): New macros.
258 * name-lookup.c (pushdecl_maybe_friend): Adjust.
259 * search.c (check_final_overrider): Adjust.
260 * decl.c (check_redeclaration_exception_specification): Adjust.
261 (use_eh_spec_block): Use type_throw_all_p.
262 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
263 Give operator new a noexcept-specification in C++0x mode.
264 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
265 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
267 Implement noexcept operator (5.3.7)
268 * cp-tree.def (NOEXCEPT_EXPR): New.
269 * except.c (check_noexcept_r, finish_noexcept_expr): New.
270 * cp-tree.h: Declare finish_noexcept_expr.
271 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
272 * pt.c (tsubst_copy_and_build): And tsubst it.
273 (type_dependent_expression_p): Handle it.
274 (value_dependent_expression_p): Handle it.
276 * call.c (build_conditional_expr): Never fold in unevaluated context.
277 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
278 * semantics.c (simplify_aggr_init_expr): Likewise.
279 * typeck.c (merge_types): Call merge_exception_specifiers.
280 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
281 DECL_ANTICIPATED for preferring new type.
283 2010-06-04 Joseph Myers <joseph@codesourcery.com>
285 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
288 2010-06-04 Jakub Jelinek <jakub@redhat.com>
291 * typeck.c (build_class_member_access_expr): Call mark_exp_read
292 on object for static data members.
294 2010-06-04 Jakub Jelinek <jakub@redhat.com>
295 Jason Merrill <jason@redhat.com>
298 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
299 with the same type, call mark_lvalue_use on both.
301 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
303 * class.c (struct vtbl_init_data_s): Remove last_init field.
304 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
306 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
308 (build_vtt): Likewise.
309 (initialize_vtable): Take a VEC instead of a tree.
310 (build_vtt_inits): Change return type to void. Take a VEC **
311 instead of a tree *; accumulate results into said VEC.
312 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
313 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
314 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
316 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
317 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
319 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
320 rather than tree_cons.
321 (build_vbase_offset_vtbl_entries): Likewise.
322 (add_vcall_offset): Likewise.
323 (build_rtti_vtbl_entries): Likewise.
324 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
325 * decl.c (initialize_artificial_var): Use build_constructor instead
326 of build_constructor_from_list.
328 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
331 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
334 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
336 * parser.c (cp_parser_mem_initializer_list): Change error text.
338 2010-06-02 Jakub Jelinek <jakub@redhat.com>
340 * cp-objcp-common.c (shadowed_var_for_decl): Change into
341 tree_decl_map hashtab from tree_map.
342 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
343 (init_shadowed_var_for_decl): Adjust initialization.
346 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
347 instead of calling mark_exp_read only when not an assignment.
350 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
351 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
352 Set DECL_VALUE_EXPR on var.
354 2010-06-02 Jason Merrill <jason@redhat.com>
356 * error.c (dump_type): Improve typedef handling.
361 * name-lookup.c (same_entity_p): New.
362 (ambiguous_decl): Multiple declarations of the same entity
365 2010-06-01 Jason Merrill <jason@redhat.com>
368 * call.c (add_list_candidates): Prefer the default constructor.
369 (build_aggr_conv): Treat missing initializers like { }.
370 * typeck2.c (process_init_constructor_record): Likewise.
371 * init.c (expand_default_init): Use digest_init for
372 direct aggregate initialization, too.
374 * call.c (add_list_candidates): Split out...
375 (build_user_type_conversion_1): ...from here.
376 (build_new_method_call): And here.
377 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
380 * call.c (build_list_conv): Set list-initialization flags properly.
382 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
384 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
386 2010-06-01 Arnaud Charlet <charlet@adacore.com>
387 Matthew Gingell <gingell@adacore.com>
389 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
390 * decl2.c: Include langhooks.h and c-ada-spec.h.
391 (cpp_check, collect_source_refs, collect_ada_namespace,
392 collect_all_refs): New functions.
393 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
394 * lang-specs.h: Ditto.
396 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
398 * cp-tree.h (cp_build_function_call_nary): Declare.
399 * typeck.c (cp_build_function_call_nary): Define.
400 * decl.c (register_dtor_fn): Use it instead of
401 cp_build_function_call.
402 (cxx_maybe_build_cleanup): Likewise.
403 * decl2.c (generate_ctor_or_dtor_function): Likewise.
404 * except.c (do_get_exception_ptr): Likewise.
405 (do_begin_catch): Likewise.
406 (do_allocate_exception): Likewise.
407 (do_free_exception): Likewise.
408 (build_throw): Likewise. Use cp_build_function_call_vec instead
409 of cp_build_function_call.
410 (do_end_catch): Likewise.
412 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
414 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
415 (struct cp_declarator): Move id_loc field up.
417 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
419 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
420 this file is included before c-common.h. Define GCC_DIAG_STYLE
421 before including diagnostic-core.h and toplev.h.
422 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
423 * pt.c: Include cp-tree.h before c-common.h.
425 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
427 * tree.c (c_register_addr_space): Add stub.
429 2010-05-28 Joseph Myers <joseph@codesourcery.com>
431 * g++spec.c (lang_specific_driver): Use fatal_error instead of
434 2010-05-28 Dodji Seketeli <dodji@redhat.com>
436 Revert fix of PR c++/44188
437 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
439 * tree.c (typedef_variant_p): Revert moving this definition to
441 * decl.c (grokdeclarator): Revert naming typedef handling.
443 2010-05-27 Joseph Myers <joseph@codesourcery.com>
445 * call.c: Include diagnostic-core.h instead of diagnostic.h.
446 * cp-lang.c: Don't include diagnostic.h
447 * name-lookup.c: Include diagnostic-core.h instead of
449 (cp_emit_debug_info_for_using): Use seen_error.
450 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
451 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
452 * pt.c (iterative_hash_template_arg): Use seen_error.
453 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
454 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
455 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
456 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
459 2010-05-25 Dodji Seketeli <dodji@redhat.com>
462 * cp-tree.h (typedef_variant_p): Move this declaration to
464 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
465 * decl.c (grokdeclarator): Do not rename debug info of an
466 anonymous tagged type named by a typedef.
468 2010-05-27 Jason Merrill <jason@redhat.com>
471 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
474 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
477 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
478 * class.c (layout_class_type): Likewise.
479 * decl.c (finish_enum): Likewise.
480 * mangle.c (write_builitin_type): Likewise.
482 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
484 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
486 * decl.c (grokdeclarator): Handle __int128.
487 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
488 (cp_parser_simple_type_specifier): Likewise.
489 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
490 * typeck.c (cp_common_type): Handle __int128.
491 * mangle.c (integer_type_codes): Add itk_int128 and
494 2010-05-26 Jason Merrill <jason@redhat.com>
497 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
500 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
502 * cp-lang.c: Do not include expr.h.
504 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
506 * decl.c: Do not include rtl.h
507 * semantics.c: Likewise.
509 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
511 * cp-tree.h: Do not include splay-tree.h.
512 (struct prtmem_cst): Remove unused field and false comment.
513 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
514 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
515 * init.c: Do not include rtl.h and expr.h.
516 * class.c: Do not include rtl.h. Include splay-tree.h.
517 (build_clone): Use plain NULL instead of NULL_RTX.
518 * decl.c: Do not include expr.h. Explain why rtl.h has to be
519 included. Include splay-tree.h.
520 * method.c: Do not include rtl.h and expr.h.
521 (use_thunk): Use plain NULL instead of NULL_RTX.
522 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
523 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
524 and target.h. Include splay-tree.h.
525 * expr.c: Do not include rtl.h and expr.h.
526 * pt.c: Do not include obstack.h and rtl.h.
527 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
528 (tsubst_decl): Likewise.
529 (instantiate_decl): Likewise.
530 * semantics.c: Do not include exprt.h and debug.h. Explain why
531 rtl.h has to be included.
532 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
533 * call.c: Do not include rtl.h and expr.h.
534 * search.c: Do not include obstack.h and rtl.h.
535 * friend.c: Do not include rtl.h and expr.h.
536 * Make-lang.in: Update dependencies.
538 2010-05-25 Jakub Jelinek <jakub@redhat.com>
541 * parser.c (non_integral_constant): Add NIC_NONE.
542 (required_token): Add RT_NONE.
543 (cp_parser_unary_expression): Initialize non_constant_p
545 (cp_parser_asm_definition): Initialize missing to RT_NONE.
546 (cp_parser_primary_expression, cp_parser_postfix_expression,
547 cp_parser_cast_expression, cp_parser_binary_expression,
548 cp_parser_functional_cast): Fix formatting.
550 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
553 * parser.c: Remove inclusion of dyn-string.h.
554 (non_integral_constant): New enum.
555 (name_lookup_error): New enum.
556 (required_token): New enum.
557 (cp_parser_required_error): New function.
558 (cp_parser_require): Change the type of variable token_desc to
559 required_token and use cp_parser_required_error.
560 (cp_parser_require_keyword): Likewise.
561 (cp_parser_error): Use gmsgid as parameter.
562 (cp_parser_name_lookup_error): Change the type of variable desired to
563 name_lookup_error and put the diagnostic in the full sentences. Change
565 (cp_parser_non_integral_constant_expression): Change the type of the
566 variable thing to non_integral_constant and put the diagnostics in
567 full sentences. Change caller.
569 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
572 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
574 2010-05-24 Joseph Myers <joseph@codesourcery.com>
576 * error.c (cp_diagnostic_starter): Update call to
577 diagnostic_build_prefix.
578 (cp_print_error_function,
579 print_instantiation_partial_context_line): Check show_column flag
582 2010-05-24 Jason Merrill <jason@redhat.com>
585 * decl.c (check_initializer): Don't wrap an init-list in a
587 * init.c (build_aggr_init): Don't assume copy-initialization if
588 init has CONSTRUCTOR_IS_DIRECT_INIT.
589 * call.c (build_new_method_call): Sanity check.
591 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
593 * rtti.c (tinfo_base_init): Use build_constructor instead of
594 build_constructor_from_list. Don't cons a tree node for
596 (generic_initializer): Use build_constructor_single instead of
597 build_constructor_from_list.
598 (ptr_initializer): Use build_constructor instead of
599 build_constructor_from_list
600 (ptm_initializer): Likewise.
601 (class_initializer): Likewise. Take varargs instead of TRAIL.
602 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
603 build_constructor instead of build_constructor_from_list.
605 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
607 * semantics.c: Include bitmap.h.
608 * Make-lang.in: Update dependencies.
610 2010-05-22 Jan Hubicka <jh@suse.cz>
612 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
614 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
616 2010-05-21 Joseph Myers <joseph@codesourcery.com>
618 * cxx-pretty-print.c: Correct merge error.
620 2010-05-21 Joseph Myers <joseph@codesourcery.com>
622 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
623 (cp_print_error_function): Use diagnostic_abstract_origin macro.
624 (cp_printer): Handle %K here using percent_K_format.
625 * cxx-pretty-print.c: Include tree-pretty-print.h.
626 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
629 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
631 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
632 Clean up redundant includes.
634 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
637 * decl.c (xref_basetypes): Return false in case of ill-formed
640 2010-05-19 Jason Merrill <jason@redhat.com>
642 * call.c (reference_binding): Use cp_build_qualified_type_real
643 and cp_type_quals consistently.
644 (add_function_candidate): Likewise.
645 (build_conditional_expr): Likewise.
646 (convert_like_real): Likewise.
647 (type_passed_as): Likewise.
648 * class.c (add_method): Likewise.
649 (same_signature_p): Likewise.
650 (layout_class_type): Likewise.
651 * decl.c (cxx_init_decl_processing): Likewise.
652 (cp_fname_init): Likewise.
653 (grokdeclarator): Likewise.
654 * decl2.c (cp_reconstruct_complex_type): Likewise.
655 * init.c (build_new_1): Likewise.
656 * method.c (do_build_copy_constructor): Likewise.
657 (implicitly_declare_fn): Likewise.
658 * pt.c (tsubst_aggr_type): Likewise.
660 * rtti.c (init_rtti_processing): Likewise.
661 (build_headof): Likewise.
662 (build_dynamic_cast_1): Likewise.
663 (tinfo_base_init): Likewise.
664 (emit_support_tinfos): Likewise.
665 * semantics.c (capture_decltype): Likewise.
666 * tree.c (cv_unqualified): Likewise.
667 * typeck.c (composite_pointer_type): Likewise.
668 (string_conv_p): Likewise.
670 * mangle.c (write_CV_qualifiers_for_type): Tweak.
672 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
673 * decl.c (start_decl): Likewise.
674 * semantics.c (finish_compound_literal): Likewise.
675 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
676 (cp_type_readonly): Remove.
677 * cp-tree.h: Remove declaration.
679 * typeck.c (merge_types): Preserve memfn quals.
681 * decl.c (grokdeclarator): Don't check quals on fn type.
682 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
683 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
686 * typeck.c (type_memfn_quals): New fn.
687 (apply_memfn_quals): New fn.
688 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
689 (cp_type_readonly): Use cp_type_quals.
690 * cp-tree.h: Add declarations.
691 * tree.c (cp_build_qualified_type_real): Don't set, but do
692 preserve, quals on FUNCTION_TYPE.
693 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
694 * decl.c (build_ptrmem_type): Likewise.
695 (grokdeclarator): Likewise.
696 (static_fn_type): Likewise.
697 * decl2.c (change_return_type): Likewise.
698 (cp_reconstruct_complex_type): Likewise.
699 * pt.c (tsubst_function_type): Likewise.
701 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
703 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
705 * tree.c (build_min_non_dep_call_vec): Update comment.
707 2010-05-17 Jason Merrill <jason@redhat.com>
709 * call.c (struct z_candidate): Add explicit_targs field.
710 (add_template_candidate_real): Set it.
711 (build_over_call): Use it to control init-list warning.
714 * call.c (build_over_call): Limit init-list deduction warning to
715 cases where the argument is actually an init-list.
718 * call.c (build_over_call): Don't do bitwise copy for move ctor.
720 2010-05-17 Dodji Seketeli <dodji@redhat.com>
721 Jason Merrill <jason@redhat.com>
724 * decl.c (compute_array_index_type): Call mark_rvalue_use.
726 2010-05-15 Jason Merrill <jason@redhat.com>
728 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
729 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
731 (finish_eh_spec_block): Adjust.
733 2010-05-15 Jakub Jelinek <jakub@redhat.com>
736 * pt.c (tsubst): Unshare template argument.
738 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
740 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
741 * Make-lang.in: Fix dependencies accordingly.
743 2010-05-14 Jason Merrill <jason@redhat.com>
746 * except.c (build_throw): Simplify, adjust for DR 475.
749 * except.c (dtor_nothrow): Return nonzero for type with
753 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
754 gimple_build_eh_must_not_throw.
756 2010-05-14 Martin Jambor <mjambor@suse.cz>
758 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
761 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
763 * call.c (build_new_method_call): Change warning text.
764 * typeck2.c (build_functional_cast): Change error text.
766 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
769 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
770 shadowing the outer parameter or variables by the declaration of
771 nested function in nested structure or class. Warn the shadowing by
772 the declaration of nested lambda expression.
774 2010-05-13 Jason Merrill <jason@redhat.com>
776 * typeck.c (cp_build_array_ref): Factor out from...
777 (build_array_ref): ...here. Drop complain parm.
778 (build_new_op): Adjust.
779 * class.c (build_vtbl_ref_1): Adjust.
780 * decl2.c (grok_array_decl): Adjust.
781 * cp-tree.h: Adjust prototypes.
783 2010-05-13 Jan Hubicka <jh@suse.cz>
785 * decl.c (cp_finish_decl): Do not worry about used attribute.
787 2010-05-12 Jason Merrill <jason@redhat.com>
789 * typeck.c (build_array_ref): Take complain parm.
790 * cp-tree.h: Add it to prototype.
791 * call.c (build_new_op): Pass it.
792 * class.c (build_vtbl_ref): Pass it.
793 * decl2.c (grok_array_decl): Pass it.
797 * cp-tree.def (NULLPTR_TYPE): Remove.
798 * cp-tree.h (NULLPTR_TYPE_P): New.
799 (SCALAR_TYPE_P): Use it.
800 (nullptr_type_node): New.
801 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
802 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
804 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
805 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
806 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
807 * mangle.c (write_type): Likewise.
808 * name-lookup.c (arg_assoc_type): Likewise.
809 * typeck.c (build_reinterpret_cast_1): Likewise.
810 * rtti.c (typeinfo_in_lib_p): Likewise.
811 (emit_support_tinfos): Remove local nullptr_type_node.
813 * cp-tree.h (UNKNOWN_TYPE): Remove.
814 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
815 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
816 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
817 * class.c (instantiate_type): Check unknown_type_node rather than
819 * name-lookup.c (maybe_push_decl): Likewise.
820 * rtti.c (get_tinfo_decl_dynamic): Likewise.
821 (get_typeid): Likewise.
822 * semantics.c (finish_offsetof): Likewise.
825 * call.c (add_template_candidate_real): If deduction fails, still
826 add the template as a non-viable candidate.
827 (equal_functions): Handle template candidates.
828 (print_z_candidate): Likewise.
829 (print_z_candidates): Likewise.
830 (build_new_function_call): Likewise.
832 * cp-tree.h (LOOKUP_LIST_ONLY): New.
833 * call.c (add_candidates): Enforce it.
834 (build_new_method_call): Try non-list ctor if no viable list ctor.
835 (build_user_type_conversion_1): Likewise.
837 * call.c (add_candidates): Distinguish between type(x) and
839 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
840 (build_new_method_call): Give better error for conversion op.
842 * call.c (add_candidates): Add first_arg and return_type parms.
843 Add special constructor/conversion op handling.
844 (convert_class_to_reference): Use it.
845 (build_user_type_conversion_1): Likewise.
846 (build_op_call): Likewise.
847 (build_new_method_call): Likewise.
848 (build_new_op): Adjust.
849 (perform_overload_resolution): Adjust.
851 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
856 * pt.c (process_partial_specialization): Return error_mark_node
857 in case of unused template parameters in partial specialization.
859 2010-05-11 Jakub Jelinek <jakub@redhat.com>
862 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
863 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
864 look at its second operand.
866 2010-05-10 Jason Merrill <jason@redhat.com>
869 * semantics.c (baselink_for_fns): Revert earlier change.
872 * typeck.c (cp_build_modify_expr): Complain about assignment to
873 array from init list.
875 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
878 * decl.c (check_initializer): strip array type before checking for
879 uninitialized const or ref members.
881 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
884 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
885 error count. Emit errors only if compain is true.
886 (build_new_1): Do not return error_mark_node if
887 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
888 errors. Delay the check for user-provided constructor.
889 (perform_member_init): Adjust.
890 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
893 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
894 Jason Merrill <jason@redhat.com>
896 Add support for C++0x nullptr.
897 * cp-tree.def: Add NULLPTR_TYPE.
898 * cp-tree.h: Add nullptr_node.
899 (cp_tree_index): Add CPTI_NULLPTR.
900 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
901 * call.c (null_ptr_cst_p): Handle nullptr.
902 (standard_conversion): Likewise.
903 (convert_arg_to_ellipsis): Likewise.
904 * mangle.c (write_type): Likewise.
905 * name-lookup.c (arg_assoc_type): Likewise.
906 * parser.c (cp_parser_primary_expression): Likewise.
907 * typeck.c (cp_build_binary_op): Likewise.
908 (build_reinterpret_cast_1): Likewise.
909 * error.c (dump_type): Likewise.
910 (dump_type_prefix, dump_type_suffix): Likewise.
911 * decl.c (cxx_init_decl_processing): Likewise.
912 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
913 * cvt.c (ocp_convert): Likewise.
914 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
915 nullptr_t tinfo in libsupc++.
917 2010-05-06 Jason Merrill <jason@redhat.com>
919 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
921 2010-04-22 Jakub Jelinek <jakub@redhat.com>
922 Dodji Seketeli <dodji@redhat.com>
925 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
927 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
928 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
929 (decay_conversion, perform_integral_promotions): Call rvalue_use.
930 (cp_build_unary_op): Call lvalue_use.
931 * decl.c (unused_but_set_errorcount): New variable.
932 (poplevel): Issue -Wunused-but-set-variable diagnostics.
933 (duplicate_decls): Merge DECL_READ_P flags.
934 (start_cleanup_fn): Set DECL_READ_P flag.
935 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
936 * tree.c (rvalue): Call rvalue_use.
937 * pt.c (convert_nontype_argument): Likewise.
938 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
939 finish_decltype_type): Likewise.
940 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
941 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
942 or rvalue_use depending on the expr.
943 * init.c (build_new, build_delete): Likewise.
944 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
946 2010-05-05 Jason Merrill <jason@redhat.com>
949 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
950 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
952 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
955 * pt.c (unify): Check each elt for error_mark_node.
957 2010-05-04 Jason Merrill <jason@redhat.com>
960 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
962 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
965 * call.c (build_new_method_call): Return error_mark_node if fns is
968 2010-05-03 Dodji Seketeli <dodji@redhat.com>
971 * pt.c (most_specialized_class): Pretend we are processing
972 a template decl during the call to coerce_template_parms.
974 2010-05-03 Jason Merrill <jason@redhat.com>
978 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
979 from the selected underlying type unless -fstrict-enums. Set
980 ENUM_UNDERLYING_TYPE to have the restricted range.
981 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
982 * class.c (check_bitfield_decl): Likewise.
984 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
987 * init.c (build_new_1): Revert the accidental checkin in
990 2010-04-30 Jason Merrill <jason@redhat.com>
993 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
994 (pp_cxx_type_specifier_seq): ...here.
996 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
998 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
999 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
1001 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
1004 * typeck.c (warn_args_num): New function.
1005 (convert_arguments): Use warn_args_num to print the diagnostic
1008 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
1011 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
1012 user-provided constructor while recursing.
1014 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
1017 * error.c (print_instantiation_partial_context_line): Handle
1018 recursive instantiation.
1019 (print_instantiation_partial_context): Likewise.
1021 2010-04-27 Jason Merrill <jason@redhat.com>
1023 * init.c (perform_member_init): Check CLASS_TYPE_P.
1025 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1028 * init.c (perform_member_init): check for uninitialized const or
1029 reference members, including array types.
1031 2010-04-24 Jason Merrill <jason@redhat.com>
1033 * tree.c (get_fns): Split out from get_first_fn.
1034 * cp-tree.h: Declare it.
1035 * search.c (shared_member_p): Use it.
1036 * semantics.c (finish_qualified_id_expr): Simplify.
1037 (finish_id_expression): Simplify.
1039 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
1040 whenever object is NULL_TREE. Don't do 'this' capture here.
1041 (finish_qualified_id_expr): Pass NULL_TREE.
1042 (finish_id_expression): Likewise.
1043 (lambda_expr_this_capture): Likewise.
1045 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
1046 rather than checking current_class_ref directly.
1047 (finish_call_expr): Likewise.
1050 * name-lookup.c (qualify_lookup): Disqualify lambda op().
1051 * class.c (current_nonlambda_class_type): New fn.
1052 * semantics.c (nonlambda_method_basetype): New.
1053 * cp-tree.h: Declare them.
1054 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
1056 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
1059 * semantics.c (lambda_return_type): Complain about
1063 * tree.c (cv_unqualified): Handle error_mark_node.
1066 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
1067 if we don't want errors.
1070 * class.c (convert_to_base): Add complain parameter. Pass
1071 ba_quiet to lookup_base if we don't want errors.
1072 (build_vfield_ref): Pass complain to convert_to_base.
1073 * call.c (convert_like_real): Likewise.
1074 (initialize_reference): Likewise.
1075 (perform_direct_initialization_if_possible): Pass complain to
1077 * cp-tree.h: Adjust.
1079 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
1080 Jason Merrill <jason@redhat.com>
1083 * decl.c (check_for_uninitialized_const_var): Handle classes that need
1085 (check_initializer): Call it for classes that need constructing, too.
1086 * class.c (in_class_defaulted_default_constructor): New.
1087 * cp-tree.h: Declare it.
1089 2010-04-20 Jason Merrill <jason@redhat.com>
1092 * init.c (constant_value_1): Treat error_mark_node as a constant
1093 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
1094 * cvt.c (ocp_convert): Handle getting error_mark_node from
1095 integral_constant_value.
1096 * decl.c (compute_array_index_type): Likewise.
1098 2010-04-20 Dodji Seketeli <dodji@redhat.com>
1102 * typeck.c (incompatible_dependent_types_p): If one of the
1103 compared types if not a typedef then honour their main variant
1106 2010-04-20 Jakub Jelinek <jakub@redhat.com>
1108 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
1110 2010-04-19 Dodji Seketeli <dodji@redhat.com>
1113 * typeck.c (structural_comptypes): Test dependent typedefs
1114 incompatibility before testing for their main variant based
1117 2010-04-19 Jakub Jelinek <jakub@redhat.com>
1119 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
1120 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
1122 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
1124 * decl.c (cxx_init_decl_processing): Remove second argument in call to
1125 build_common_tree_nodes.
1127 2010-04-14 Jason Merrill <jason@redhat.com>
1130 * parser.c (cp_parser_parenthesized_expression_list): Change
1131 is_attribute_list parm to int to indicate whether or not to
1132 handle initial identifier specially.
1133 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
1135 2010-04-13 Jason Merrill <jason@redhat.com>
1137 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
1139 * parser.c (cp_parser_lambda_expression): Complain about lambda in
1140 unevaluated context.
1141 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
1143 2010-04-12 Jason Merrill <jason@redhat.com>
1146 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
1147 return value directly.
1149 * call.c (type_decays_to): Call cv_unqualified for non-class type.
1151 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
1154 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
1155 * init.c (build_new_1): Check for uninitialized const members and
1156 uninitialized reference members, when using new without
1157 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
1158 (diagnose_uninitialized_cst_or_ref_member): Define, call
1159 diagnose_uninitialized_cst_or_ref_member_1.
1160 (diagnose_uninitialized_cst_or_ref_member_1): New function.
1162 2010-04-12 Richard Guenther <rguenther@suse.de>
1165 * semantics.c (expand_or_defer_fn_1): Do not keep extern
1166 template inline functions.
1168 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1171 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
1174 2010-04-07 Jason Merrill <jason@redhat.com>
1177 * decl.c (start_preparsed_function): Do defer nested functions.
1179 PR c++/11094, DR 408
1180 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
1181 * decl2.c (finish_static_data_member_decl): Set it.
1182 * decl.c (duplicate_decls): Propagate it.
1183 * pt.c (tsubst_decl): Don't substitute the domain of an array
1184 VAR_DECL if it's set.
1185 (regenerate_decl_from_template): Substitute it here.
1186 (type_dependent_expression_p): Return true if it's set.
1187 * semantics.c (finish_decltype_type): Instantiate such a variable.
1188 * typeck.c (cxx_sizeof_expr): Likewise.
1189 (strip_array_domain): New.
1192 * name-lookup.c (current_decl_namespace): Non-static.
1193 (pop_nested_namespace): Sanity check.
1194 * cp-tree.h: Declare current_decl_namespace.
1195 * decl.c (grokvardecl): Use it instead of current_namespace.
1196 (grokfndecl): Likewise.
1199 * pt.c (tsubst_friend_function): Instatiate a friend that has already
1202 * pt.c (print_template_statistics): New.
1203 * cp-tree.h: Declare it.
1204 * tree.c (cxx_print_statistics): Call it.
1207 * decl.c (grokvardecl): Tweak warning message.
1208 (grokfndecl): Likewise.
1210 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1213 *pt.c (tsubst_decl): Get the arguments of a specialization from
1214 the specialization template, not from the most general template.
1216 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1219 * typeck2.c (process_init_constructor_record):
1220 value-initialize members that are are not explicitely
1223 2010-04-07 Jie Zhang <jie@codesourcery.com>
1226 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
1227 when all of its elements are non-constant and have been split out.
1229 2010-04-06 Taras Glek <taras@mozilla.com>
1230 Jason Merrill <jason@redhat.com>
1232 * parser.c (cp_parser_class_specifier): Set class location to that
1233 of IDENTIFIER_NODE instead of '{' when possible.
1234 * semantics.c (begin_class_definition): Do not overide locations
1235 with less precise ones.
1237 2010-04-06 Jason Merrill <jason@redhat.com>
1240 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
1243 * pt.c (maybe_update_decl_type): Check the return value from
1246 2010-04-01 Jason Merrill <jason@redhat.com>
1248 * decl.c (next_initializable_field): No longer static.
1249 * cp-tree.h: Declare it.
1250 * call.c (build_aggr_conv): Fail if there are more initializers
1251 than initializable fields.
1253 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
1254 instead of void_zero_node.
1256 2010-03-31 Dodji Seketeli <dodji@redhat.com>
1259 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
1260 * pt.c (end_template_parm_list): Store sibling template parms of
1261 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1262 (push_template_decl_real): Don't store the containing template decl
1263 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
1264 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
1265 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1268 2010-03-30 Jason Merrill <jason@redhat.com>
1271 * pt.c (push_template_decl_real): Deal better with running out of
1272 scopes before running out of template parms.
1276 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
1277 function parameter context. Don't print an error if parsing
1281 * pt.c (more_specialized_fn): Don't control cv-qualifier check
1284 2010-03-26 Jason Merrill <jason@redhat.com>
1287 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
1288 c++0x mode, but not other type-names.
1290 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1293 * pt.c (add_to_template_args): Support NULL ARGS;
1294 (most_specialized_class): call coerce_template_parms on
1295 template arguments passed to get_class_bindings. Use
1296 add_to_template_args.
1297 (unify): Handle VAR_DECLs.
1299 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1301 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
1303 * pt.c (get_template_parms_at_level): Adjust.
1305 2010-03-25 Dodji Seketeli <dodji@redhat.com>
1308 * cp-tree.h (get_template_parms_at_level): Declare ...
1309 * pt.c (get_template_parms_at_level): ... new function.
1310 * typeck.c (get_template_parms_of_dependent_type): If a template
1311 type parm's DECL_CONTEXT isn't yet set, get its siblings from
1312 current_template_parms. Use get_template_parms_at_level. Remove
1314 (incompatible_dependent_types_p): If we get empty parms from just one
1315 of the template type parms we are comparing then the template parms are
1318 2010-03-24 Jason Merrill <jason@redhat.com>
1321 * parser.c (make_declarator): Initialize id_loc.
1322 (cp_parser_lambda_declarator_opt): And set it.
1324 2010-03-23 Jason Merrill <jason@redhat.com>
1326 Make lambda conversion op and op() non-static.
1327 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
1328 Also add the thunk function returned by the conversion op.
1329 Mark the conversion deleted if the op() is variadic.
1330 * decl2.c (mark_used): Give helpful message about deleted conversion.
1331 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
1332 * semantics.c (finish_this_expr): Adjust.
1333 * mangle.c (write_closure_type_name): Adjust.
1334 * decl.c (grok_op_properties): Don't allow it.
1335 * call.c (build_user_type_conversion_1): No static conversion ops.
1336 (build_op_call): Or op().
1338 * decl2.c (change_return_type): Fix 'this' quals.
1340 2010-03-22 Jason Merrill <jason@redhat.com>
1343 * tree.c (pod_type_p): Use old meaning in C++98 mode.
1346 * pt.c (contains_auto_r): New fn.
1347 (do_auto_deduction): Use it.
1348 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
1350 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
1353 * decl2.c (grokfield): Handle invalid initializers for member
1356 2010-03-20 Dodji Seketeli <dodji@redhat.com>
1359 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
1361 * decl2.c (vague_linkage_p): Likewise.
1363 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1366 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
1367 false, in the cp_parser_expression_statement call.
1369 2010-03-05 Jason Merrill <jason@redhat.com>
1371 * mangle.c (mangle_decl): Give name collision error even without
1374 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
1376 * pt.c (process_partial_specialization): Use error_n instead of
1379 2010-03-03 Jason Merrill <jason@redhat.com>
1382 * mangle.c (mangle_decl): Handle VAR_DECL, too.
1384 2010-03-03 Jason Merrill <jason@redhat.com>
1387 * mangle.c: Include cgraph.h.
1388 (mangle_decl): If the mangled name will change in a later
1389 ABI version, make the later mangled name an alias.
1390 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
1391 * Make-lang.in (mangle.o): Depend on cgraph.h.
1392 * method.c (make_alias_for): Handle VAR_DECL, too.
1393 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
1394 * tree.c (no_linkage_check): Adjust.
1395 * decl.c (maybe_commonize_var): Adjust.
1396 * cp-tree.h: Adjust.
1398 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
1400 * pt.c (redeclare_class_template): Use error_n and inform_n.
1402 2010-02-27 Mark Mitchell <mark@codesourcery.com>
1405 * cp-tree.h (push_tinst_level): Declare.
1406 (pop_tinst_level): Likewise.
1407 * pt.c (push_tinst_level): Give it external linkage.
1408 (pop_tinst_level): Likewise.
1409 * mangle.c (mangle_decl_string): Set the source location to that
1410 of the decl while mangling.
1412 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
1415 * pt.c (redeclare_class_template): Return false if there are erroneous
1416 template parameters.
1418 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
1420 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
1423 2010-02-24 Jason Merrill <jason@redhat.com>
1426 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
1428 * class.c (layout_class_type): Don't give -Wabi warning for a bug
1429 in a previous ABI version.
1431 2010-02-23 Jason Merrill <jason@redhat.com>
1434 * typeck2.c (digest_init_r): Accept value init of array.
1436 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
1439 * typeck.c (convert_arguments): Update error message.
1441 2010-02-22 Mike Stump <mikestump@comcast.net>
1444 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
1446 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1449 * error.c (print_instantiation_partial_context_line): New.
1450 (print_instantiation_partial_context): Print at most 12 contexts,
1451 skip the rest with a message.
1453 2010-02-21 Dodji Seketeli <dodji@redhat.com>
1456 * pt.c (lookup_template_class): Better support of specialization
1457 of member of class template implicit instantiation.
1459 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
1462 * call.c (conversion_null_warnings): Replace -Wconversion with
1464 * cvt.c (build_expr_type_conversion): Likewise.
1466 2010-02-18 Jason Merrill <jason@redhat.com>
1469 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
1472 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
1474 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
1475 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
1478 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
1482 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
1483 (maybe_update_decl_type): New fn.
1484 * parser.c (cp_parser_init_declarator): Use it.
1487 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
1489 2010-02-17 Jason Merrill <jason@redhat.com>
1492 * call.c (build_over_call): Don't create zero-sized assignments.
1493 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
1494 * cp-objcp-common.c (cp_expr_size): Remove.
1495 * cp-tree.h: Remove prototype.
1498 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
1499 decl we looked up doesn't match.
1502 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
1503 have an INIT_EXPR anymore.
1506 * pt.c (convert_nontype_argument): Change assert to test.
1508 2010-02-16 Jason Merrill <jason@redhat.com>
1510 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
1513 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
1514 VIEW_CONVERT_EXPR for conversions between structural equality types
1515 that the back end can't tell are the same.
1518 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
1519 cv-quals from element here.
1520 (cp_build_qualified_type_real): Not here. Preserve typedef name.
1522 2010-02-14 Jason Merrill <jason@redhat.com>
1525 * semantics.c (finish_compound_literal): Use
1526 cp_apply_type_quals_to_decl when creating a static variable.
1528 2010-02-12 Jason Merrill <jason@redhat.com>
1531 * name-lookup.h (current_binding_level): Check for null
1534 2010-02-12 Jason Merrill <jason@redhat.com>
1537 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
1539 2010-02-12 Jakub Jelinek <jakub@redhat.com>
1542 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
1545 2010-02-10 Jason Merrill <jason@redhat.com>
1548 * semantics.c (outer_lambda_capture_p): Revert.
1549 (add_capture): Only finish_member_declaration if
1550 we're in the lambda class.
1551 (register_capture_members): New.
1552 * cp-tree.h: Declare it.
1553 * parser.c (cp_parser_lambda_expression): Call it.
1555 2010-02-10 Jason Merrill <jason@redhat.com>
1558 * semantics.c (outer_lambda_capture_p): Use current_function_decl
1559 instead of current_class_type.
1561 2010-02-10 Jason Merrill <jason@redhat.com>
1563 PR c++/42983, core issue 906
1564 * method.c (defaultable_fn_check): Check virtualness.
1566 2010-02-10 Jason Merrill <jason@redhat.com>
1569 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
1571 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
1573 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
1574 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
1576 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
1577 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
1578 (cp_parser_parameter_declaration)
1579 (cp_parser_exception_specification_opt)
1580 (cp_parser_exception_declaration): Likewise.
1581 * pt.c (check_default_tmpl_args): Likewise.
1582 * search.c (lookup_field_r): Likewise.
1584 2010-02-09 Jason Merrill <jason@redhat.com>
1587 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
1589 2010-02-09 Jason Merrill <jason@redhat.com>
1592 * decl2.c (change_return_type): New fn.
1593 * semantics.c (apply_lambda_return_type): Use it.
1594 * cp-tree.h: Declare it.
1596 2010-02-05 Richard Guenther <rguenther@suse.de>
1598 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
1599 * cp-lang.c: Include gt-cp-cp-lang.h.
1600 * config-lang.in (gtfiles): Add cp/cp-lang.c.
1602 2010-02-05 Dodji Seketeli <dodji@redhat.com>
1605 * typeck.c (get_template_parms_of_dependent_type): Try getting
1606 the template parameters fromt the type itself first.
1608 2010-02-03 Jason Merrill <jason@redhat.com>
1612 * mangle.c (write_unqualified_id): Split out from write_expression.
1613 (write_unqualified_name): Call it.
1614 (write_member_name): Likewise.
1615 (write_expression): Support TEMPLATE_ID_EXPR.
1616 Disambiguate operator names.
1619 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
1622 2010-02-02 Jason Merrill <jason@redhat.com>
1625 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
1626 * optimize.c (clone_body): Remap their initializers when making base
1628 (maybe_clone_body): Complain if multiple clones aren't safe.
1630 2010-01-29 Dodji Seketeli <dodji@redhat.com>
1637 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1638 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1639 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
1640 * pt.c (coerce_template_parms, type_unification_real,
1641 expand_template_argument_pack, coerce_template_parameter_pack):
1642 Set the non default template args count.
1643 (current_template_args): Always set non defaulted
1644 template args count when compiled with --enable-checking
1645 (tsubst_template_args, type_unification_real): Propagate the non
1646 defaulted template args count.
1647 * error.c (get_non_default_template_args_count): Renamed
1648 count_non_default_template_args into this. Don't calculate the
1649 non default template argument count anymore. Use the new
1650 accessor macros above to get it.
1651 (dump_template_argument_list, dump_type, dump_decl,
1652 dump_template_parms): Adjust.
1653 * parser.c (cp_parser_template_argument_list): Always set defaulted
1654 template args count when compiled with --enable-checking.
1656 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
1658 * decl.c (redeclaration_error_message): Wrap the return messages into
1659 G_() for easy translation.
1661 2010-01-28 Jason Merrill <jason@redhat.com>
1664 * semantics.c (begin_class_definition): Don't use type_as_string.
1666 2010-01-28 Dodji Seketeli <dodji@redhat.com>
1670 * typeck.c (get_template_parms_of_dependent_type): Factorized
1671 this out of incompatible_template_type_parms_p
1672 (incompatible_dependent_types_p): Renamed
1673 incompatible_template_type_parms_p into this. Make it detect
1674 two incompatible dependent typedefs too.
1675 (structural_comptypes): Use incompatible_dependent_types_p.
1676 * pt.c (get_template_info):
1677 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
1679 2010-01-20 Janis Johnson <janis187@us.ibm.com>
1680 Jason Merrill <jason@redhat.com>
1682 * mangle.c (write_type): Mangle transparent record as member type.
1683 * semantics.c (begin_class_definition): Recognize decimal classes
1684 and set TYPE_TRANSPARENT_AGGR.
1686 2010-01-20 Jason Merrill <jason@redhat.com>
1689 * mangle.c (write_expression): Handle tree codes that have extra
1690 arguments in the middle-end.
1692 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
1695 * except.c (expand_start_catch_block): Deal correctly with
1696 do_begin_catch returning error_mark_node.
1698 2010-01-20 Jason Merrill <jason@redhat.com>
1701 * class.c (layout_class_type): Set packed_maybe_necessary for packed
1705 * semantics.c (build_lambda_object): Call mark_used on captured
1709 * decl.c (grokdeclarator): Clear type_quals for a member function
1710 declared using a typedef. Don't complain about adding cv-quals
1711 to a function typedef in C++0x mode.
1713 2010-01-20 Jakub Jelinek <jakub@redhat.com>
1715 * decl.c (create_array_type_for_decl): Remove set but not used
1716 variable error_msg. Remove break stmts after return stmts.
1718 2010-01-19 Dodji Seketeli <dodji@redhat.com>
1720 * error.c (dump_template_parms, count_non_default_template_args):
1721 Revert fix of PR c++/42634.
1723 2010-01-18 Dodji Seketeli <dodji@redhat.com>
1726 * error.c (dump_template_parms): Use innermost template
1727 arguments before calling count_non_default_template_args.
1728 (count_non_default_template_args): We are being called with
1729 template innermost arguments now. There is no need to ensure
1732 2010-01-18 Dodji Seketeli <dodji@redhat.com>
1735 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
1737 2010-01-17 Dodji Seketeli <dodji@redhat.com>
1740 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
1742 2010-01-17 Dodji Seketeli <dodji@redhat.com>
1745 *pt.c (tsubst_decl): Get the arguments of a specialization from
1746 the specialization template, not from the most general template.
1748 2010-01-16 Jason Merrill <jason@redhat.com>
1751 * semantics.c (finish_decltype_type): Within a template, treat
1752 unresolved CALL_EXPR as dependent.
1754 2010-01-15 Dodji Seketeli <dodji@redhat.com>
1756 * error.c (dump_template_parms,count_non_default_template_args):
1757 Revert changes of PR c++/42634.
1759 2010-01-14 Jakub Jelinek <jakub@redhat.com>
1762 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
1763 functions with noreturn attribute.
1765 2010-01-14 Jason Merrill <jason@redhat.com>
1768 * call.c (build_new_method_call): Don't free the vec here.
1771 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
1773 2010-01-13 Dodji Seketeli <dodji@redhat.com>
1776 * error.c (dump_template_parms): Use innermost template
1777 arguments before calling count_non_default_template_args.
1778 (count_non_default_template_args): We are being called with
1779 template innermost arguments now. There is no need to ensure
1782 2010-01-07 Dodji Seketeli <dodji@redhat.com>
1785 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
1786 arguments that were previously deduced.
1788 2010-01-05 Jason Merrill <jason@redhat.com>
1790 * pt.c (unify_pack_expansion): Handle deduction from init-list.
1791 * call.c (build_over_call): Don't complain about it.
1793 2010-01-04 Jason Merrill <jason@redhat.com>
1796 * pt.c (tsubst_decl): Don't apply type attributes in place.
1799 * semantics.c (describable_type): Remove decltype comment and
1804 Copyright (C) 2010 Free Software Foundation, Inc.
1806 Copying and distribution of this file, with or without modification,
1807 are permitted in any medium without royalty provided the copyright
1808 notice and this notice are preserved.