1 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
3 * cp-tree.h (expr_list_kind): New type.
4 (impl_conv_rhs): New type.
5 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
7 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
8 diagnostics for easy translation. Change caller.
9 (convert_for_initialization): Use impl_conv_rhs and change caller.
10 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
11 diagnostics for easy translation. Change caller.
12 * decl.c (bad_spec_place): New enum.
13 (bad_specifiers): Use it and emit the diagnostics for easy
14 translation. Change caller.
15 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
17 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
19 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
21 * decl2.c (cp_write_global_declarations): Adjust for new type of
23 * name-lookup.c (current_decl_namespace): Likewise.
24 (push_decl_namespace): Likewise.
25 (pop_decl_namespace): Likewise.
27 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
29 * call.c (build_java_interface_fn_ref): Call build_function_type_list
30 instead of build_function_type.
31 * decl.c (cxx_init_decl_processing): Likewise.
32 (declare_global_var): Likewise.
33 (get_atexit_node): Likewise.
34 (expand_static_init): Likewise.
35 * decl2.c (start_objects): Likewise.
36 (start_static_storage_duration_function): Likewise.
37 * except.c (init_exception_processing): Likewise.
38 (build_exc_ptr): Likewise.
39 (build_throw): Likewise.
40 * rtti.c (throw_bad_cast): Likewise.
41 (throw_bad_typeid): Likewise.
42 (build_dynamic_cast_1): Likewise.
44 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
46 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
47 (build_op_delete_call): Likewise.
48 (build_over_call): Likewise.
49 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
50 * pt.c (process_partial_specialization): Likewise.
51 (tsubst_template_args): Likewise.
52 * semantics.c (finish_asm_stmt): Likewise.
54 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
56 * decl.c (record_key_method_defined): New, broken out of ...
57 (finish_function): ... here. Call it.
58 (start_decl): Treat aliases as definitions.
60 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
62 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
64 * pt.c (maybe_process_partial_specialization): Likewise.
65 (register_specialization): Likewise.
66 (add_pending_template): Likewise.
67 (lookup_template_class): Likewise.
68 (push_tinst_level): Likewise.
70 * parser.c (cp_lexer_new_main): Likewise.
71 (cp_lexer_new_from_tokens): Likewise.
72 (cp_token_cache_new): Likewise.
73 (cp_parser_context_new): Likewise.
74 (cp_parser_new): Likewise.
75 (cp_parser_nested_name_specifier_opt): Likewise.
76 (cp_parser_template_id): Likewise.
78 * name-lookup.c (binding_entry_make): Likewise.
79 (binding_table_construct): Likewise.
80 (binding_table_new): Likewise.
81 (cxx_binding_make): Likewise.
82 (pushdecl_maybe_friend): Likewise.
83 (begin_scope): Likewise.
84 (push_to_top_level): Likewise.
86 * lex.c (init_reswords): Likewise.
87 (retrofit_lang_decl): Likewise.
88 (cxx_dup_lang_specific_decl): Likewise.
89 (copy_lang_type): Likewise.
90 (cxx_make_type): Likewise.
92 * decl.c (make_label_decl): Likewise.
93 (check_goto): Likewise.
94 (start_preparsed_function): Likewise.
95 (save_function_data): Likewise.
97 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
99 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
101 * class.c (finish_struct_1): Likewise.
103 * cp-tree.h (struct lang_type): Add variable_size GTY option.
104 (struct lang_decl): Likewise.
106 * parser.c (cp_parser_new): Update comment to not reference
109 2010-06-07 Jason Merrill <jason@redhat.com>
112 * error.c (dump_parameters): Mask out TFF_SCOPE.
113 (dump_simple_decl): Don't print the scope of a PARM_DECL.
114 (dump_scope): Remove no-op mask.
117 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
119 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
120 * init.c (build_offset_ref): Use it.
121 * pt.c (maybe_process_partial_specialization): Use it.
122 (instantiate_class_template): Use it.
123 * search.c (lookup_base): Use it.
125 2010-06-07 Jakub Jelinek <jakub@redhat.com>
128 * expr.c (mark_exp_read): Handle INDIRECT_REF.
129 * cvt.c (convert_to_void): Handle INDIRECT_REF like
133 * decl.c (initialize_local_var): If TREE_USED is set on the type,
134 set also DECL_READ_P on the decl.
136 2010-05-25 Dodji Seketeli <dodji@redhat.com>
139 * cp-tree.h (typedef_variant_p): Move this declaration to
141 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
142 * decl.c (grokdeclarator): Do not rename debug info of an
143 anonymous tagged type named by a typedef.
145 2010-06-05 Fabien ChĂȘne <fabien@gcc.gnu.org>
148 * class.c (check_field_decls): Move the call to
149 check_bitfield_decl before trying to set the
150 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
152 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
154 * typeck.c: Update include path for moved files.
157 * cp-gimplify.c: Likewise.
158 * cp-lang.c: Likewise.
160 * semantics.c: Likewise.
161 * cxx-pretty-print.h: Likewise.
163 * parser.c: Likewise.
164 * cp-objcp-common.c: Likewise.
165 * cp-tree.h: Likewise.
166 * name-lookup.c: Likewise.
168 * name-lookup.h: Likewise.
169 * config-lang.in: Update paths in gtfiles for files in c-family/.
170 * Make-lang.in: Likewise.
172 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
174 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
175 * typeck.c (build_ptrmemfunc): Likewise.
177 2010-06-04 Jason Merrill <jason@redhat.com>
179 * typeck2.c (merge_exception_specifiers): Adjust merging of
180 throw() and noexcept(true).
182 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
183 using an uninitialized variable.
185 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
186 (pp_cxx_expression): Likewise.
188 Implement noexcept-specification (15.4)
189 * parser.c (cp_parser_exception_specification_opt): Parse it.
190 Give -Wdeprecated warning about throw() specs.
191 * pt.c (tsubst_exception_specification): Handle it.
192 * error.c (dump_exception_spec): Handle it.
193 (dump_expr): Handle NOEXCEPT_EXPR.
194 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
195 * typeck.c (comp_except_specs): Handle compatibility rules.
196 Change exact parm to take an enum.
197 * typeck2.c (merge_exception_specifiers): Handle noexcept.
198 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
199 (type_throw_all_p, build_noexcept_spec): New fns.
200 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
201 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
202 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
203 (noexcept_true_spec, noexcept_false_spec): New macros.
204 * name-lookup.c (pushdecl_maybe_friend): Adjust.
205 * search.c (check_final_overrider): Adjust.
206 * decl.c (check_redeclaration_exception_specification): Adjust.
207 (use_eh_spec_block): Use type_throw_all_p.
208 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
209 Give operator new a noexcept-specification in C++0x mode.
210 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
211 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
213 Implement noexcept operator (5.3.7)
214 * cp-tree.def (NOEXCEPT_EXPR): New.
215 * except.c (check_noexcept_r, finish_noexcept_expr): New.
216 * cp-tree.h: Declare finish_noexcept_expr.
217 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
218 * pt.c (tsubst_copy_and_build): And tsubst it.
219 (type_dependent_expression_p): Handle it.
220 (value_dependent_expression_p): Handle it.
222 * call.c (build_conditional_expr): Never fold in unevaluated context.
223 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
224 * semantics.c (simplify_aggr_init_expr): Likewise.
225 * typeck.c (merge_types): Call merge_exception_specifiers.
226 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
227 DECL_ANTICIPATED for preferring new type.
229 2010-06-04 Joseph Myers <joseph@codesourcery.com>
231 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
234 2010-06-04 Jakub Jelinek <jakub@redhat.com>
237 * typeck.c (build_class_member_access_expr): Call mark_exp_read
238 on object for static data members.
240 2010-06-04 Jakub Jelinek <jakub@redhat.com>
241 Jason Merrill <jason@redhat.com>
244 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
245 with the same type, call mark_lvalue_use on both.
247 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
249 * class.c (struct vtbl_init_data_s): Remove last_init field.
250 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
252 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
254 (build_vtt): Likewise.
255 (initialize_vtable): Take a VEC instead of a tree.
256 (build_vtt_inits): Change return type to void. Take a VEC **
257 instead of a tree *; accumulate results into said VEC.
258 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
259 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
260 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
262 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
263 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
265 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
266 rather than tree_cons.
267 (build_vbase_offset_vtbl_entries): Likewise.
268 (add_vcall_offset): Likewise.
269 (build_rtti_vtbl_entries): Likewise.
270 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
271 * decl.c (initialize_artificial_var): Use build_constructor instead
272 of build_constructor_from_list.
274 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
277 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
280 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
282 * parser.c (cp_parser_mem_initializer_list): Change error text.
284 2010-06-02 Jakub Jelinek <jakub@redhat.com>
286 * cp-objcp-common.c (shadowed_var_for_decl): Change into
287 tree_decl_map hashtab from tree_map.
288 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
289 (init_shadowed_var_for_decl): Adjust initialization.
292 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
293 instead of calling mark_exp_read only when not an assignment.
296 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
297 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
298 Set DECL_VALUE_EXPR on var.
300 2010-06-02 Jason Merrill <jason@redhat.com>
302 * error.c (dump_type): Improve typedef handling.
307 * name-lookup.c (same_entity_p): New.
308 (ambiguous_decl): Multiple declarations of the same entity
311 2010-06-01 Jason Merrill <jason@redhat.com>
314 * call.c (add_list_candidates): Prefer the default constructor.
315 (build_aggr_conv): Treat missing initializers like { }.
316 * typeck2.c (process_init_constructor_record): Likewise.
317 * init.c (expand_default_init): Use digest_init for
318 direct aggregate initialization, too.
320 * call.c (add_list_candidates): Split out...
321 (build_user_type_conversion_1): ...from here.
322 (build_new_method_call): And here.
323 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
326 * call.c (build_list_conv): Set list-initialization flags properly.
328 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
330 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
332 2010-06-01 Arnaud Charlet <charlet@adacore.com>
333 Matthew Gingell <gingell@adacore.com>
335 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
336 * decl2.c: Include langhooks.h and c-ada-spec.h.
337 (cpp_check, collect_source_refs, collect_ada_namespace,
338 collect_all_refs): New functions.
339 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
340 * lang-specs.h: Ditto.
342 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
344 * cp-tree.h (cp_build_function_call_nary): Declare.
345 * typeck.c (cp_build_function_call_nary): Define.
346 * decl.c (register_dtor_fn): Use it instead of
347 cp_build_function_call.
348 (cxx_maybe_build_cleanup): Likewise.
349 * decl2.c (generate_ctor_or_dtor_function): Likewise.
350 * except.c (do_get_exception_ptr): Likewise.
351 (do_begin_catch): Likewise.
352 (do_allocate_exception): Likewise.
353 (do_free_exception): Likewise.
354 (build_throw): Likewise. Use cp_build_function_call_vec instead
355 of cp_build_function_call.
356 (do_end_catch): Likewise.
358 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
360 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
361 (struct cp_declarator): Move id_loc field up.
363 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
365 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
366 this file is included before c-common.h. Define GCC_DIAG_STYLE
367 before including diagnostic-core.h and toplev.h.
368 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
369 * pt.c: Include cp-tree.h before c-common.h.
371 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
373 * tree.c (c_register_addr_space): Add stub.
375 2010-05-28 Joseph Myers <joseph@codesourcery.com>
377 * g++spec.c (lang_specific_driver): Use fatal_error instead of
380 2010-05-28 Dodji Seketeli <dodji@redhat.com>
382 Revert fix of PR c++/44188
383 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
385 * tree.c (typedef_variant_p): Revert moving this definition to
387 * decl.c (grokdeclarator): Revert naming typedef handling.
389 2010-05-27 Joseph Myers <joseph@codesourcery.com>
391 * call.c: Include diagnostic-core.h instead of diagnostic.h.
392 * cp-lang.c: Don't include diagnostic.h
393 * name-lookup.c: Include diagnostic-core.h instead of
395 (cp_emit_debug_info_for_using): Use seen_error.
396 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
397 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
398 * pt.c (iterative_hash_template_arg): Use seen_error.
399 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
400 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
401 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
402 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
405 2010-05-25 Dodji Seketeli <dodji@redhat.com>
408 * cp-tree.h (typedef_variant_p): Move this declaration to
410 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
411 * decl.c (grokdeclarator): Do not rename debug info of an
412 anonymous tagged type named by a typedef.
414 2010-05-27 Jason Merrill <jason@redhat.com>
417 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
420 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
423 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
424 * class.c (layout_class_type): Likewise.
425 * decl.c (finish_enum): Likewise.
426 * mangle.c (write_builitin_type): Likewise.
428 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
430 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
432 * decl.c (grokdeclarator): Handle __int128.
433 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
434 (cp_parser_simple_type_specifier): Likewise.
435 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
436 * typeck.c (cp_common_type): Handle __int128.
437 * mangle.c (integer_type_codes): Add itk_int128 and
440 2010-05-26 Jason Merrill <jason@redhat.com>
443 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
446 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
448 * cp-lang.c: Do not include expr.h.
450 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
452 * decl.c: Do not include rtl.h
453 * semantics.c: Likewise.
455 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
457 * cp-tree.h: Do not include splay-tree.h.
458 (struct prtmem_cst): Remove unused field and false comment.
459 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
460 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
461 * init.c: Do not include rtl.h and expr.h.
462 * class.c: Do not include rtl.h. Include splay-tree.h.
463 (build_clone): Use plain NULL instead of NULL_RTX.
464 * decl.c: Do not include expr.h. Explain why rtl.h has to be
465 included. Include splay-tree.h.
466 * method.c: Do not include rtl.h and expr.h.
467 (use_thunk): Use plain NULL instead of NULL_RTX.
468 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
469 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
470 and target.h. Include splay-tree.h.
471 * expr.c: Do not include rtl.h and expr.h.
472 * pt.c: Do not include obstack.h and rtl.h.
473 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
474 (tsubst_decl): Likewise.
475 (instantiate_decl): Likewise.
476 * semantics.c: Do not include exprt.h and debug.h. Explain why
477 rtl.h has to be included.
478 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
479 * call.c: Do not include rtl.h and expr.h.
480 * search.c: Do not include obstack.h and rtl.h.
481 * friend.c: Do not include rtl.h and expr.h.
482 * Make-lang.in: Update dependencies.
484 2010-05-25 Jakub Jelinek <jakub@redhat.com>
487 * parser.c (non_integral_constant): Add NIC_NONE.
488 (required_token): Add RT_NONE.
489 (cp_parser_unary_expression): Initialize non_constant_p
491 (cp_parser_asm_definition): Initialize missing to RT_NONE.
492 (cp_parser_primary_expression, cp_parser_postfix_expression,
493 cp_parser_cast_expression, cp_parser_binary_expression,
494 cp_parser_functional_cast): Fix formatting.
496 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
499 * parser.c: Remove inclusion of dyn-string.h.
500 (non_integral_constant): New enum.
501 (name_lookup_error): New enum.
502 (required_token): New enum.
503 (cp_parser_required_error): New function.
504 (cp_parser_require): Change the type of variable token_desc to
505 required_token and use cp_parser_required_error.
506 (cp_parser_require_keyword): Likewise.
507 (cp_parser_error): Use gmsgid as parameter.
508 (cp_parser_name_lookup_error): Change the type of variable desired to
509 name_lookup_error and put the diagnostic in the full sentences. Change
511 (cp_parser_non_integral_constant_expression): Change the type of the
512 variable thing to non_integral_constant and put the diagnostics in
513 full sentences. Change caller.
515 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
518 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
520 2010-05-24 Joseph Myers <joseph@codesourcery.com>
522 * error.c (cp_diagnostic_starter): Update call to
523 diagnostic_build_prefix.
524 (cp_print_error_function,
525 print_instantiation_partial_context_line): Check show_column flag
528 2010-05-24 Jason Merrill <jason@redhat.com>
531 * decl.c (check_initializer): Don't wrap an init-list in a
533 * init.c (build_aggr_init): Don't assume copy-initialization if
534 init has CONSTRUCTOR_IS_DIRECT_INIT.
535 * call.c (build_new_method_call): Sanity check.
537 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
539 * rtti.c (tinfo_base_init): Use build_constructor instead of
540 build_constructor_from_list. Don't cons a tree node for
542 (generic_initializer): Use build_constructor_single instead of
543 build_constructor_from_list.
544 (ptr_initializer): Use build_constructor instead of
545 build_constructor_from_list
546 (ptm_initializer): Likewise.
547 (class_initializer): Likewise. Take varargs instead of TRAIL.
548 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
549 build_constructor instead of build_constructor_from_list.
551 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
553 * semantics.c: Include bitmap.h.
554 * Make-lang.in: Update dependencies.
556 2010-05-22 Jan Hubicka <jh@suse.cz>
558 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
560 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
562 2010-05-21 Joseph Myers <joseph@codesourcery.com>
564 * cxx-pretty-print.c: Correct merge error.
566 2010-05-21 Joseph Myers <joseph@codesourcery.com>
568 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
569 (cp_print_error_function): Use diagnostic_abstract_origin macro.
570 (cp_printer): Handle %K here using percent_K_format.
571 * cxx-pretty-print.c: Include tree-pretty-print.h.
572 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
575 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
577 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
578 Clean up redundant includes.
580 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
583 * decl.c (xref_basetypes): Return false in case of ill-formed
586 2010-05-19 Jason Merrill <jason@redhat.com>
588 * call.c (reference_binding): Use cp_build_qualified_type_real
589 and cp_type_quals consistently.
590 (add_function_candidate): Likewise.
591 (build_conditional_expr): Likewise.
592 (convert_like_real): Likewise.
593 (type_passed_as): Likewise.
594 * class.c (add_method): Likewise.
595 (same_signature_p): Likewise.
596 (layout_class_type): Likewise.
597 * decl.c (cxx_init_decl_processing): Likewise.
598 (cp_fname_init): Likewise.
599 (grokdeclarator): Likewise.
600 * decl2.c (cp_reconstruct_complex_type): Likewise.
601 * init.c (build_new_1): Likewise.
602 * method.c (do_build_copy_constructor): Likewise.
603 (implicitly_declare_fn): Likewise.
604 * pt.c (tsubst_aggr_type): Likewise.
606 * rtti.c (init_rtti_processing): Likewise.
607 (build_headof): Likewise.
608 (build_dynamic_cast_1): Likewise.
609 (tinfo_base_init): Likewise.
610 (emit_support_tinfos): Likewise.
611 * semantics.c (capture_decltype): Likewise.
612 * tree.c (cv_unqualified): Likewise.
613 * typeck.c (composite_pointer_type): Likewise.
614 (string_conv_p): Likewise.
616 * mangle.c (write_CV_qualifiers_for_type): Tweak.
618 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
619 * decl.c (start_decl): Likewise.
620 * semantics.c (finish_compound_literal): Likewise.
621 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
622 (cp_type_readonly): Remove.
623 * cp-tree.h: Remove declaration.
625 * typeck.c (merge_types): Preserve memfn quals.
627 * decl.c (grokdeclarator): Don't check quals on fn type.
628 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
629 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
632 * typeck.c (type_memfn_quals): New fn.
633 (apply_memfn_quals): New fn.
634 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
635 (cp_type_readonly): Use cp_type_quals.
636 * cp-tree.h: Add declarations.
637 * tree.c (cp_build_qualified_type_real): Don't set, but do
638 preserve, quals on FUNCTION_TYPE.
639 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
640 * decl.c (build_ptrmem_type): Likewise.
641 (grokdeclarator): Likewise.
642 (static_fn_type): Likewise.
643 * decl2.c (change_return_type): Likewise.
644 (cp_reconstruct_complex_type): Likewise.
645 * pt.c (tsubst_function_type): Likewise.
647 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
649 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
651 * tree.c (build_min_non_dep_call_vec): Update comment.
653 2010-05-17 Jason Merrill <jason@redhat.com>
655 * call.c (struct z_candidate): Add explicit_targs field.
656 (add_template_candidate_real): Set it.
657 (build_over_call): Use it to control init-list warning.
660 * call.c (build_over_call): Limit init-list deduction warning to
661 cases where the argument is actually an init-list.
664 * call.c (build_over_call): Don't do bitwise copy for move ctor.
666 2010-05-17 Dodji Seketeli <dodji@redhat.com>
667 Jason Merrill <jason@redhat.com>
670 * decl.c (compute_array_index_type): Call mark_rvalue_use.
672 2010-05-15 Jason Merrill <jason@redhat.com>
674 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
675 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
677 (finish_eh_spec_block): Adjust.
679 2010-05-15 Jakub Jelinek <jakub@redhat.com>
682 * pt.c (tsubst): Unshare template argument.
684 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
686 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
687 * Make-lang.in: Fix dependencies accordingly.
689 2010-05-14 Jason Merrill <jason@redhat.com>
692 * except.c (build_throw): Simplify, adjust for DR 475.
695 * except.c (dtor_nothrow): Return nonzero for type with
699 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
700 gimple_build_eh_must_not_throw.
702 2010-05-14 Martin Jambor <mjambor@suse.cz>
704 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
707 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
709 * call.c (build_new_method_call): Change warning text.
710 * typeck2.c (build_functional_cast): Change error text.
712 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
715 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
716 shadowing the outer parameter or variables by the declaration of
717 nested function in nested structure or class. Warn the shadowing by
718 the declaration of nested lambda expression.
720 2010-05-13 Jason Merrill <jason@redhat.com>
722 * typeck.c (cp_build_array_ref): Factor out from...
723 (build_array_ref): ...here. Drop complain parm.
724 (build_new_op): Adjust.
725 * class.c (build_vtbl_ref_1): Adjust.
726 * decl2.c (grok_array_decl): Adjust.
727 * cp-tree.h: Adjust prototypes.
729 2010-05-13 Jan Hubicka <jh@suse.cz>
731 * decl.c (cp_finish_decl): Do not worry about used attribute.
733 2010-05-12 Jason Merrill <jason@redhat.com>
735 * typeck.c (build_array_ref): Take complain parm.
736 * cp-tree.h: Add it to prototype.
737 * call.c (build_new_op): Pass it.
738 * class.c (build_vtbl_ref): Pass it.
739 * decl2.c (grok_array_decl): Pass it.
743 * cp-tree.def (NULLPTR_TYPE): Remove.
744 * cp-tree.h (NULLPTR_TYPE_P): New.
745 (SCALAR_TYPE_P): Use it.
746 (nullptr_type_node): New.
747 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
748 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
750 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
751 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
752 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
753 * mangle.c (write_type): Likewise.
754 * name-lookup.c (arg_assoc_type): Likewise.
755 * typeck.c (build_reinterpret_cast_1): Likewise.
756 * rtti.c (typeinfo_in_lib_p): Likewise.
757 (emit_support_tinfos): Remove local nullptr_type_node.
759 * cp-tree.h (UNKNOWN_TYPE): Remove.
760 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
761 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
762 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
763 * class.c (instantiate_type): Check unknown_type_node rather than
765 * name-lookup.c (maybe_push_decl): Likewise.
766 * rtti.c (get_tinfo_decl_dynamic): Likewise.
767 (get_typeid): Likewise.
768 * semantics.c (finish_offsetof): Likewise.
771 * call.c (add_template_candidate_real): If deduction fails, still
772 add the template as a non-viable candidate.
773 (equal_functions): Handle template candidates.
774 (print_z_candidate): Likewise.
775 (print_z_candidates): Likewise.
776 (build_new_function_call): Likewise.
778 * cp-tree.h (LOOKUP_LIST_ONLY): New.
779 * call.c (add_candidates): Enforce it.
780 (build_new_method_call): Try non-list ctor if no viable list ctor.
781 (build_user_type_conversion_1): Likewise.
783 * call.c (add_candidates): Distinguish between type(x) and
785 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
786 (build_new_method_call): Give better error for conversion op.
788 * call.c (add_candidates): Add first_arg and return_type parms.
789 Add special constructor/conversion op handling.
790 (convert_class_to_reference): Use it.
791 (build_user_type_conversion_1): Likewise.
792 (build_op_call): Likewise.
793 (build_new_method_call): Likewise.
794 (build_new_op): Adjust.
795 (perform_overload_resolution): Adjust.
797 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
802 * pt.c (process_partial_specialization): Return error_mark_node
803 in case of unused template parameters in partial specialization.
805 2010-05-11 Jakub Jelinek <jakub@redhat.com>
808 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
809 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
810 look at its second operand.
812 2010-05-10 Jason Merrill <jason@redhat.com>
815 * semantics.c (baselink_for_fns): Revert earlier change.
818 * typeck.c (cp_build_modify_expr): Complain about assignment to
819 array from init list.
821 2010-05-10 Fabien ChĂȘne <fabien.chene@gmail.com>
824 * decl.c (check_initializer): strip array type before checking for
825 uninitialized const or ref members.
827 2010-05-07 Fabien ChĂȘne <fabien.chene@gmail.com>
830 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
831 error count. Emit errors only if compain is true.
832 (build_new_1): Do not return error_mark_node if
833 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
834 errors. Delay the check for user-provided constructor.
835 (perform_member_init): Adjust.
836 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
839 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
840 Jason Merrill <jason@redhat.com>
842 Add support for C++0x nullptr.
843 * cp-tree.def: Add NULLPTR_TYPE.
844 * cp-tree.h: Add nullptr_node.
845 (cp_tree_index): Add CPTI_NULLPTR.
846 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
847 * call.c (null_ptr_cst_p): Handle nullptr.
848 (standard_conversion): Likewise.
849 (convert_arg_to_ellipsis): Likewise.
850 * mangle.c (write_type): Likewise.
851 * name-lookup.c (arg_assoc_type): Likewise.
852 * parser.c (cp_parser_primary_expression): Likewise.
853 * typeck.c (cp_build_binary_op): Likewise.
854 (build_reinterpret_cast_1): Likewise.
855 * error.c (dump_type): Likewise.
856 (dump_type_prefix, dump_type_suffix): Likewise.
857 * decl.c (cxx_init_decl_processing): Likewise.
858 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
859 * cvt.c (ocp_convert): Likewise.
860 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
861 nullptr_t tinfo in libsupc++.
863 2010-05-06 Jason Merrill <jason@redhat.com>
865 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
867 2010-04-22 Jakub Jelinek <jakub@redhat.com>
868 Dodji Seketeli <dodji@redhat.com>
871 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
873 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
874 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
875 (decay_conversion, perform_integral_promotions): Call rvalue_use.
876 (cp_build_unary_op): Call lvalue_use.
877 * decl.c (unused_but_set_errorcount): New variable.
878 (poplevel): Issue -Wunused-but-set-variable diagnostics.
879 (duplicate_decls): Merge DECL_READ_P flags.
880 (start_cleanup_fn): Set DECL_READ_P flag.
881 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
882 * tree.c (rvalue): Call rvalue_use.
883 * pt.c (convert_nontype_argument): Likewise.
884 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
885 finish_decltype_type): Likewise.
886 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
887 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
888 or rvalue_use depending on the expr.
889 * init.c (build_new, build_delete): Likewise.
890 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
892 2010-05-05 Jason Merrill <jason@redhat.com>
895 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
896 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
898 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
901 * pt.c (unify): Check each elt for error_mark_node.
903 2010-05-04 Jason Merrill <jason@redhat.com>
906 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
908 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
911 * call.c (build_new_method_call): Return error_mark_node if fns is
914 2010-05-03 Dodji Seketeli <dodji@redhat.com>
917 * pt.c (most_specialized_class): Pretend we are processing
918 a template decl during the call to coerce_template_parms.
920 2010-05-03 Jason Merrill <jason@redhat.com>
924 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
925 from the selected underlying type unless -fstrict-enums. Set
926 ENUM_UNDERLYING_TYPE to have the restricted range.
927 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
928 * class.c (check_bitfield_decl): Likewise.
930 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
933 * init.c (build_new_1): Revert the accidental checkin in
936 2010-04-30 Jason Merrill <jason@redhat.com>
939 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
940 (pp_cxx_type_specifier_seq): ...here.
942 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
944 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
945 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
947 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
950 * typeck.c (warn_args_num): New function.
951 (convert_arguments): Use warn_args_num to print the diagnostic
954 2010-04-29 Fabien ChĂȘne <fabien.chene@gmail.com>
957 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
958 user-provided constructor while recursing.
960 2010-04-28 Manuel López-Ibåñez <manu@gcc.gnu.org>
963 * error.c (print_instantiation_partial_context_line): Handle
964 recursive instantiation.
965 (print_instantiation_partial_context): Likewise.
967 2010-04-27 Jason Merrill <jason@redhat.com>
969 * init.c (perform_member_init): Check CLASS_TYPE_P.
971 2010-04-27 Fabien ChĂȘne <fabien.chene@gmail.com>
974 * init.c (perform_member_init): check for uninitialized const or
975 reference members, including array types.
977 2010-04-24 Jason Merrill <jason@redhat.com>
979 * tree.c (get_fns): Split out from get_first_fn.
980 * cp-tree.h: Declare it.
981 * search.c (shared_member_p): Use it.
982 * semantics.c (finish_qualified_id_expr): Simplify.
983 (finish_id_expression): Simplify.
985 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
986 whenever object is NULL_TREE. Don't do 'this' capture here.
987 (finish_qualified_id_expr): Pass NULL_TREE.
988 (finish_id_expression): Likewise.
989 (lambda_expr_this_capture): Likewise.
991 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
992 rather than checking current_class_ref directly.
993 (finish_call_expr): Likewise.
996 * name-lookup.c (qualify_lookup): Disqualify lambda op().
997 * class.c (current_nonlambda_class_type): New fn.
998 * semantics.c (nonlambda_method_basetype): New.
999 * cp-tree.h: Declare them.
1000 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
1002 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
1005 * semantics.c (lambda_return_type): Complain about
1009 * tree.c (cv_unqualified): Handle error_mark_node.
1012 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
1013 if we don't want errors.
1016 * class.c (convert_to_base): Add complain parameter. Pass
1017 ba_quiet to lookup_base if we don't want errors.
1018 (build_vfield_ref): Pass complain to convert_to_base.
1019 * call.c (convert_like_real): Likewise.
1020 (initialize_reference): Likewise.
1021 (perform_direct_initialization_if_possible): Pass complain to
1023 * cp-tree.h: Adjust.
1025 2010-04-27 Fabien ChĂȘne <fabien.chene@gmail.com>
1026 Jason Merrill <jason@redhat.com>
1029 * decl.c (check_for_uninitialized_const_var): Handle classes that need
1031 (check_initializer): Call it for classes that need constructing, too.
1032 * class.c (in_class_defaulted_default_constructor): New.
1033 * cp-tree.h: Declare it.
1035 2010-04-20 Jason Merrill <jason@redhat.com>
1038 * init.c (constant_value_1): Treat error_mark_node as a constant
1039 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
1040 * cvt.c (ocp_convert): Handle getting error_mark_node from
1041 integral_constant_value.
1042 * decl.c (compute_array_index_type): Likewise.
1044 2010-04-20 Dodji Seketeli <dodji@redhat.com>
1048 * typeck.c (incompatible_dependent_types_p): If one of the
1049 compared types if not a typedef then honour their main variant
1052 2010-04-20 Jakub Jelinek <jakub@redhat.com>
1054 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
1056 2010-04-19 Dodji Seketeli <dodji@redhat.com>
1059 * typeck.c (structural_comptypes): Test dependent typedefs
1060 incompatibility before testing for their main variant based
1063 2010-04-19 Jakub Jelinek <jakub@redhat.com>
1065 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
1066 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
1068 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
1070 * decl.c (cxx_init_decl_processing): Remove second argument in call to
1071 build_common_tree_nodes.
1073 2010-04-14 Jason Merrill <jason@redhat.com>
1076 * parser.c (cp_parser_parenthesized_expression_list): Change
1077 is_attribute_list parm to int to indicate whether or not to
1078 handle initial identifier specially.
1079 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
1081 2010-04-13 Jason Merrill <jason@redhat.com>
1083 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
1085 * parser.c (cp_parser_lambda_expression): Complain about lambda in
1086 unevaluated context.
1087 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
1089 2010-04-12 Jason Merrill <jason@redhat.com>
1092 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
1093 return value directly.
1095 * call.c (type_decays_to): Call cv_unqualified for non-class type.
1097 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
1100 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
1101 * init.c (build_new_1): Check for uninitialized const members and
1102 uninitialized reference members, when using new without
1103 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
1104 (diagnose_uninitialized_cst_or_ref_member): Define, call
1105 diagnose_uninitialized_cst_or_ref_member_1.
1106 (diagnose_uninitialized_cst_or_ref_member_1): New function.
1108 2010-04-12 Richard Guenther <rguenther@suse.de>
1111 * semantics.c (expand_or_defer_fn_1): Do not keep extern
1112 template inline functions.
1114 2010-04-09 Manuel López-Ibåñez <manu@gcc.gnu.org>
1117 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
1120 2010-04-07 Jason Merrill <jason@redhat.com>
1123 * decl.c (start_preparsed_function): Do defer nested functions.
1125 PR c++/11094, DR 408
1126 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
1127 * decl2.c (finish_static_data_member_decl): Set it.
1128 * decl.c (duplicate_decls): Propagate it.
1129 * pt.c (tsubst_decl): Don't substitute the domain of an array
1130 VAR_DECL if it's set.
1131 (regenerate_decl_from_template): Substitute it here.
1132 (type_dependent_expression_p): Return true if it's set.
1133 * semantics.c (finish_decltype_type): Instantiate such a variable.
1134 * typeck.c (cxx_sizeof_expr): Likewise.
1135 (strip_array_domain): New.
1138 * name-lookup.c (current_decl_namespace): Non-static.
1139 (pop_nested_namespace): Sanity check.
1140 * cp-tree.h: Declare current_decl_namespace.
1141 * decl.c (grokvardecl): Use it instead of current_namespace.
1142 (grokfndecl): Likewise.
1145 * pt.c (tsubst_friend_function): Instatiate a friend that has already
1148 * pt.c (print_template_statistics): New.
1149 * cp-tree.h: Declare it.
1150 * tree.c (cxx_print_statistics): Call it.
1153 * decl.c (grokvardecl): Tweak warning message.
1154 (grokfndecl): Likewise.
1156 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1159 *pt.c (tsubst_decl): Get the arguments of a specialization from
1160 the specialization template, not from the most general template.
1162 2010-04-07 Dodji Seketeli <dodji@redhat.com>
1165 * typeck2.c (process_init_constructor_record):
1166 value-initialize members that are are not explicitely
1169 2010-04-07 Jie Zhang <jie@codesourcery.com>
1172 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
1173 when all of its elements are non-constant and have been split out.
1175 2010-04-06 Taras Glek <taras@mozilla.com>
1176 Jason Merrill <jason@redhat.com>
1178 * parser.c (cp_parser_class_specifier): Set class location to that
1179 of IDENTIFIER_NODE instead of '{' when possible.
1180 * semantics.c (begin_class_definition): Do not overide locations
1181 with less precise ones.
1183 2010-04-06 Jason Merrill <jason@redhat.com>
1186 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
1189 * pt.c (maybe_update_decl_type): Check the return value from
1192 2010-04-01 Jason Merrill <jason@redhat.com>
1194 * decl.c (next_initializable_field): No longer static.
1195 * cp-tree.h: Declare it.
1196 * call.c (build_aggr_conv): Fail if there are more initializers
1197 than initializable fields.
1199 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
1200 instead of void_zero_node.
1202 2010-03-31 Dodji Seketeli <dodji@redhat.com>
1205 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
1206 * pt.c (end_template_parm_list): Store sibling template parms of
1207 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1208 (push_template_decl_real): Don't store the containing template decl
1209 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
1210 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
1211 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
1214 2010-03-30 Jason Merrill <jason@redhat.com>
1217 * pt.c (push_template_decl_real): Deal better with running out of
1218 scopes before running out of template parms.
1222 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
1223 function parameter context. Don't print an error if parsing
1227 * pt.c (more_specialized_fn): Don't control cv-qualifier check
1230 2010-03-26 Jason Merrill <jason@redhat.com>
1233 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
1234 c++0x mode, but not other type-names.
1236 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1239 * pt.c (add_to_template_args): Support NULL ARGS;
1240 (most_specialized_class): call coerce_template_parms on
1241 template arguments passed to get_class_bindings. Use
1242 add_to_template_args.
1243 (unify): Handle VAR_DECLs.
1245 2010-03-26 Dodji Seketeli <dodji@redhat.com>
1247 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
1249 * pt.c (get_template_parms_at_level): Adjust.
1251 2010-03-25 Dodji Seketeli <dodji@redhat.com>
1254 * cp-tree.h (get_template_parms_at_level): Declare ...
1255 * pt.c (get_template_parms_at_level): ... new function.
1256 * typeck.c (get_template_parms_of_dependent_type): If a template
1257 type parm's DECL_CONTEXT isn't yet set, get its siblings from
1258 current_template_parms. Use get_template_parms_at_level. Remove
1260 (incompatible_dependent_types_p): If we get empty parms from just one
1261 of the template type parms we are comparing then the template parms are
1264 2010-03-24 Jason Merrill <jason@redhat.com>
1267 * parser.c (make_declarator): Initialize id_loc.
1268 (cp_parser_lambda_declarator_opt): And set it.
1270 2010-03-23 Jason Merrill <jason@redhat.com>
1272 Make lambda conversion op and op() non-static.
1273 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
1274 Also add the thunk function returned by the conversion op.
1275 Mark the conversion deleted if the op() is variadic.
1276 * decl2.c (mark_used): Give helpful message about deleted conversion.
1277 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
1278 * semantics.c (finish_this_expr): Adjust.
1279 * mangle.c (write_closure_type_name): Adjust.
1280 * decl.c (grok_op_properties): Don't allow it.
1281 * call.c (build_user_type_conversion_1): No static conversion ops.
1282 (build_op_call): Or op().
1284 * decl2.c (change_return_type): Fix 'this' quals.
1286 2010-03-22 Jason Merrill <jason@redhat.com>
1289 * tree.c (pod_type_p): Use old meaning in C++98 mode.
1292 * pt.c (contains_auto_r): New fn.
1293 (do_auto_deduction): Use it.
1294 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
1296 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
1299 * decl2.c (grokfield): Handle invalid initializers for member
1302 2010-03-20 Dodji Seketeli <dodji@redhat.com>
1305 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
1307 * decl2.c (vague_linkage_p): Likewise.
1309 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
1312 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
1313 false, in the cp_parser_expression_statement call.
1315 2010-03-05 Jason Merrill <jason@redhat.com>
1317 * mangle.c (mangle_decl): Give name collision error even without
1320 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
1322 * pt.c (process_partial_specialization): Use error_n instead of
1325 2010-03-03 Jason Merrill <jason@redhat.com>
1328 * mangle.c (mangle_decl): Handle VAR_DECL, too.
1330 2010-03-03 Jason Merrill <jason@redhat.com>
1333 * mangle.c: Include cgraph.h.
1334 (mangle_decl): If the mangled name will change in a later
1335 ABI version, make the later mangled name an alias.
1336 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
1337 * Make-lang.in (mangle.o): Depend on cgraph.h.
1338 * method.c (make_alias_for): Handle VAR_DECL, too.
1339 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
1340 * tree.c (no_linkage_check): Adjust.
1341 * decl.c (maybe_commonize_var): Adjust.
1342 * cp-tree.h: Adjust.
1344 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
1346 * pt.c (redeclare_class_template): Use error_n and inform_n.
1348 2010-02-27 Mark Mitchell <mark@codesourcery.com>
1351 * cp-tree.h (push_tinst_level): Declare.
1352 (pop_tinst_level): Likewise.
1353 * pt.c (push_tinst_level): Give it external linkage.
1354 (pop_tinst_level): Likewise.
1355 * mangle.c (mangle_decl_string): Set the source location to that
1356 of the decl while mangling.
1358 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
1361 * pt.c (redeclare_class_template): Return false if there are erroneous
1362 template parameters.
1364 2010-02-24 Manuel López-Ibåñez <manu@gcc.gnu.org>
1366 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
1369 2010-02-24 Jason Merrill <jason@redhat.com>
1372 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
1374 * class.c (layout_class_type): Don't give -Wabi warning for a bug
1375 in a previous ABI version.
1377 2010-02-23 Jason Merrill <jason@redhat.com>
1380 * typeck2.c (digest_init_r): Accept value init of array.
1382 2010-02-22 Manuel López-Ibåñez <manu@gcc.gnu.org>
1385 * typeck.c (convert_arguments): Update error message.
1387 2010-02-22 Mike Stump <mikestump@comcast.net>
1390 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
1392 2010-02-21 Manuel López-Ibåñez <manu@gcc.gnu.org>
1395 * error.c (print_instantiation_partial_context_line): New.
1396 (print_instantiation_partial_context): Print at most 12 contexts,
1397 skip the rest with a message.
1399 2010-02-21 Dodji Seketeli <dodji@redhat.com>
1402 * pt.c (lookup_template_class): Better support of specialization
1403 of member of class template implicit instantiation.
1405 2010-02-20 Manuel López-Ibåñez <manu@gcc.gnu.org>
1408 * call.c (conversion_null_warnings): Replace -Wconversion with
1410 * cvt.c (build_expr_type_conversion): Likewise.
1412 2010-02-18 Jason Merrill <jason@redhat.com>
1415 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
1418 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
1420 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
1421 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
1424 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
1428 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
1429 (maybe_update_decl_type): New fn.
1430 * parser.c (cp_parser_init_declarator): Use it.
1433 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
1435 2010-02-17 Jason Merrill <jason@redhat.com>
1438 * call.c (build_over_call): Don't create zero-sized assignments.
1439 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
1440 * cp-objcp-common.c (cp_expr_size): Remove.
1441 * cp-tree.h: Remove prototype.
1444 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
1445 decl we looked up doesn't match.
1448 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
1449 have an INIT_EXPR anymore.
1452 * pt.c (convert_nontype_argument): Change assert to test.
1454 2010-02-16 Jason Merrill <jason@redhat.com>
1456 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
1459 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
1460 VIEW_CONVERT_EXPR for conversions between structural equality types
1461 that the back end can't tell are the same.
1464 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
1465 cv-quals from element here.
1466 (cp_build_qualified_type_real): Not here. Preserve typedef name.
1468 2010-02-14 Jason Merrill <jason@redhat.com>
1471 * semantics.c (finish_compound_literal): Use
1472 cp_apply_type_quals_to_decl when creating a static variable.
1474 2010-02-12 Jason Merrill <jason@redhat.com>
1477 * name-lookup.h (current_binding_level): Check for null
1480 2010-02-12 Jason Merrill <jason@redhat.com>
1483 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
1485 2010-02-12 Jakub Jelinek <jakub@redhat.com>
1488 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
1491 2010-02-10 Jason Merrill <jason@redhat.com>
1494 * semantics.c (outer_lambda_capture_p): Revert.
1495 (add_capture): Only finish_member_declaration if
1496 we're in the lambda class.
1497 (register_capture_members): New.
1498 * cp-tree.h: Declare it.
1499 * parser.c (cp_parser_lambda_expression): Call it.
1501 2010-02-10 Jason Merrill <jason@redhat.com>
1504 * semantics.c (outer_lambda_capture_p): Use current_function_decl
1505 instead of current_class_type.
1507 2010-02-10 Jason Merrill <jason@redhat.com>
1509 PR c++/42983, core issue 906
1510 * method.c (defaultable_fn_check): Check virtualness.
1512 2010-02-10 Jason Merrill <jason@redhat.com>
1515 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
1517 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
1519 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
1520 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
1522 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
1523 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
1524 (cp_parser_parameter_declaration)
1525 (cp_parser_exception_specification_opt)
1526 (cp_parser_exception_declaration): Likewise.
1527 * pt.c (check_default_tmpl_args): Likewise.
1528 * search.c (lookup_field_r): Likewise.
1530 2010-02-09 Jason Merrill <jason@redhat.com>
1533 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
1535 2010-02-09 Jason Merrill <jason@redhat.com>
1538 * decl2.c (change_return_type): New fn.
1539 * semantics.c (apply_lambda_return_type): Use it.
1540 * cp-tree.h: Declare it.
1542 2010-02-05 Richard Guenther <rguenther@suse.de>
1544 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
1545 * cp-lang.c: Include gt-cp-cp-lang.h.
1546 * config-lang.in (gtfiles): Add cp/cp-lang.c.
1548 2010-02-05 Dodji Seketeli <dodji@redhat.com>
1551 * typeck.c (get_template_parms_of_dependent_type): Try getting
1552 the template parameters fromt the type itself first.
1554 2010-02-03 Jason Merrill <jason@redhat.com>
1558 * mangle.c (write_unqualified_id): Split out from write_expression.
1559 (write_unqualified_name): Call it.
1560 (write_member_name): Likewise.
1561 (write_expression): Support TEMPLATE_ID_EXPR.
1562 Disambiguate operator names.
1565 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
1568 2010-02-02 Jason Merrill <jason@redhat.com>
1571 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
1572 * optimize.c (clone_body): Remap their initializers when making base
1574 (maybe_clone_body): Complain if multiple clones aren't safe.
1576 2010-01-29 Dodji Seketeli <dodji@redhat.com>
1583 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1584 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
1585 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
1586 * pt.c (coerce_template_parms, type_unification_real,
1587 expand_template_argument_pack, coerce_template_parameter_pack):
1588 Set the non default template args count.
1589 (current_template_args): Always set non defaulted
1590 template args count when compiled with --enable-checking
1591 (tsubst_template_args, type_unification_real): Propagate the non
1592 defaulted template args count.
1593 * error.c (get_non_default_template_args_count): Renamed
1594 count_non_default_template_args into this. Don't calculate the
1595 non default template argument count anymore. Use the new
1596 accessor macros above to get it.
1597 (dump_template_argument_list, dump_type, dump_decl,
1598 dump_template_parms): Adjust.
1599 * parser.c (cp_parser_template_argument_list): Always set defaulted
1600 template args count when compiled with --enable-checking.
1602 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
1604 * decl.c (redeclaration_error_message): Wrap the return messages into
1605 G_() for easy translation.
1607 2010-01-28 Jason Merrill <jason@redhat.com>
1610 * semantics.c (begin_class_definition): Don't use type_as_string.
1612 2010-01-28 Dodji Seketeli <dodji@redhat.com>
1616 * typeck.c (get_template_parms_of_dependent_type): Factorized
1617 this out of incompatible_template_type_parms_p
1618 (incompatible_dependent_types_p): Renamed
1619 incompatible_template_type_parms_p into this. Make it detect
1620 two incompatible dependent typedefs too.
1621 (structural_comptypes): Use incompatible_dependent_types_p.
1622 * pt.c (get_template_info):
1623 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
1625 2010-01-20 Janis Johnson <janis187@us.ibm.com>
1626 Jason Merrill <jason@redhat.com>
1628 * mangle.c (write_type): Mangle transparent record as member type.
1629 * semantics.c (begin_class_definition): Recognize decimal classes
1630 and set TYPE_TRANSPARENT_AGGR.
1632 2010-01-20 Jason Merrill <jason@redhat.com>
1635 * mangle.c (write_expression): Handle tree codes that have extra
1636 arguments in the middle-end.
1638 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
1641 * except.c (expand_start_catch_block): Deal correctly with
1642 do_begin_catch returning error_mark_node.
1644 2010-01-20 Jason Merrill <jason@redhat.com>
1647 * class.c (layout_class_type): Set packed_maybe_necessary for packed
1651 * semantics.c (build_lambda_object): Call mark_used on captured
1655 * decl.c (grokdeclarator): Clear type_quals for a member function
1656 declared using a typedef. Don't complain about adding cv-quals
1657 to a function typedef in C++0x mode.
1659 2010-01-20 Jakub Jelinek <jakub@redhat.com>
1661 * decl.c (create_array_type_for_decl): Remove set but not used
1662 variable error_msg. Remove break stmts after return stmts.
1664 2010-01-19 Dodji Seketeli <dodji@redhat.com>
1666 * error.c (dump_template_parms, count_non_default_template_args):
1667 Revert fix of PR c++/42634.
1669 2010-01-18 Dodji Seketeli <dodji@redhat.com>
1672 * error.c (dump_template_parms): Use innermost template
1673 arguments before calling count_non_default_template_args.
1674 (count_non_default_template_args): We are being called with
1675 template innermost arguments now. There is no need to ensure
1678 2010-01-18 Dodji Seketeli <dodji@redhat.com>
1681 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
1683 2010-01-17 Dodji Seketeli <dodji@redhat.com>
1686 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
1688 2010-01-17 Dodji Seketeli <dodji@redhat.com>
1691 *pt.c (tsubst_decl): Get the arguments of a specialization from
1692 the specialization template, not from the most general template.
1694 2010-01-16 Jason Merrill <jason@redhat.com>
1697 * semantics.c (finish_decltype_type): Within a template, treat
1698 unresolved CALL_EXPR as dependent.
1700 2010-01-15 Dodji Seketeli <dodji@redhat.com>
1702 * error.c (dump_template_parms,count_non_default_template_args):
1703 Revert changes of PR c++/42634.
1705 2010-01-14 Jakub Jelinek <jakub@redhat.com>
1708 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
1709 functions with noreturn attribute.
1711 2010-01-14 Jason Merrill <jason@redhat.com>
1714 * call.c (build_new_method_call): Don't free the vec here.
1717 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
1719 2010-01-13 Dodji Seketeli <dodji@redhat.com>
1722 * error.c (dump_template_parms): Use innermost template
1723 arguments before calling count_non_default_template_args.
1724 (count_non_default_template_args): We are being called with
1725 template innermost arguments now. There is no need to ensure
1728 2010-01-07 Dodji Seketeli <dodji@redhat.com>
1731 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
1732 arguments that were previously deduced.
1734 2010-01-05 Jason Merrill <jason@redhat.com>
1736 * pt.c (unify_pack_expansion): Handle deduction from init-list.
1737 * call.c (build_over_call): Don't complain about it.
1739 2010-01-04 Jason Merrill <jason@redhat.com>
1742 * pt.c (tsubst_decl): Don't apply type attributes in place.
1745 * semantics.c (describable_type): Remove decltype comment and
1750 Copyright (C) 2010 Free Software Foundation, Inc.
1752 Copying and distribution of this file, with or without modification,
1753 are permitted in any medium without royalty provided the copyright
1754 notice and this notice are preserved.