1 2010-11-02 Dodji Seketeli <dodji@redhat.com>
4 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
5 (struct template_parm_index_s)<num_siblings>: New field.
6 (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
7 (process_template_parm): Extend the API to accept the number of
8 template parms in argument.
9 (cp_set_underlying_type): Remove this.
10 * class.c (build_self_reference): Require canonical type equality
11 back on the self reference of class.
12 * decl2.c (grokfield): Require canonical type equality back on
14 * name-lookup.c (pushdecl_maybe_friend): Require canonical type
15 equality back on typedefs.
16 * parser.c (cp_parser_template_parameter_list): Do not require
17 canonical type equality on dependent types created during template
19 * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
20 (fixup_template_parm, fixup_template_parms): New private
22 (current_template_args): Declare this.
23 (process_template_parm): Pass the total number of template parms
24 to canonical_type_parameter.
25 (build_template_parm_index): Add a new argument to carry the total
26 number of template parms.
27 (reduce_template_parm_level, process_template_parm, make_auto):
29 (current_template_args): Fix this for template template
31 (tsubst_template_parm): Split out of ...
32 (tsubst_template_parms): ... this.
33 (reduce_template_parm_level): Don't loose
34 TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
35 (template_parm_to_arg): Extracted this function from
36 current_template_args. Make it represent invalid template parms
37 with an error_mark_node instead of a LIST_TREE containing an
39 (current_template_args): Use template_parm_to_arg.
40 (dependent_template_arg_p): Consider an invalid template argument
42 (end_template_parm_list): Do not update template sibling parms
43 here anymore. Use fixup_template_parms instead.
44 (process_template_parm): Pass the number of template parms to
45 canonical_type_parameter.
46 (make_auto): Require structural equality on auto
47 TEMPLATE_TYPE_PARM for now.
48 (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
49 using all the arguments deduced so far.
50 (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
51 canonical_type_parameter.
52 * tree.c (cp_set_underlying_type): Remove.
53 * typeck.c (get_template_parms_of_dependent_type)
54 (incompatible_dependent_types_p): Remove.
55 (structural_comptypes): Do not call incompatible_dependent_types_p
57 (comp_template_parms_position): Re-organized. Take the length of
58 template parms list in account.
60 2010-11-01 Jason Merrill <jason@redhat.com>
62 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
63 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
64 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
65 of giving follow-on errors.
66 * error.c (maybe_print_constexpr_context): New.
67 (cp_diagnostic_starter): Call it.
68 * cp-tree.h: Declare cx_error_context.
70 * semantics.c (cxx_eval_constant_expression): Explain
71 unacceptable use of variable better.
73 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
74 Jason Merrill <jason@redhat.com>
76 * call.c (null_ptr_cst_p): Use maybe_constant_value.
77 (set_up_extended_ref_temp): Support constant initialization.
78 (initialize_reference): Adjust.
79 * class.c (check_bitfield_decl): Use cxx_constant_value.
80 * cvt.c (ocp_convert): Don't use integral_constant_value when
81 converting to class type.
82 * decl.c (finish_case_label): Use maybe_constant_value.
83 (build_init_list_var_init): Support constant initialization.
84 (check_initializer): Likewise. Reorganize.
85 (cp_finish_decl): Likewise.
86 (expand_static_init): Likewise.
87 (compute_array_index_type): Use maybe_constant_value.
89 (create_array_type_for_decl, grokdeclarator): Pass it.
90 (build_enumerator): Use cxx_constant_value.
91 * decl2.c (grokfield): Use maybe_constant_init.
92 * except.c (check_noexcept_r): Handle constexpr.
93 (build_noexcept_spec): Use maybe_constant_value.
94 * init.c (expand_default_init): Support constant initialization.
95 (build_vec_init): Likewise.
96 (constant_value_1): Adjust.
97 (build_new_1): Adjust.
98 * parser.c (cp_parser_constant_expression): Allow non-integral
100 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
101 (cp_parser_initializer_clause): Toss folded result if non-constant.
102 * pt.c (fold_decl_constant_value): Remove.
103 (convert_nontype_argument): Use maybe_constant_value. Give clearer
104 error about overflow.
105 (tsubst): Move array bounds handling into compute_array_index_type.
106 (value_dependent_expression_p): Handle constant CALL_EXPR.
107 (tsubst_decl): Don't set
108 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
109 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
110 (instantiate_decl): Here too.
111 * semantics.c (finish_static_assert): Use maybe_constant_value.
112 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
113 (potential_constant_expression): Use maybe_constant_value.
114 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
115 is potentially valid in C++0x.
116 * typeck2.c (store_init_value): Handle constant init.
117 (check_narrowing): Use maybe_constant_value.
118 (build_functional_cast): Set TREE_CONSTANT on literal T().
119 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
120 (LOOKUP_ALREADY_DIGESTED): New.
121 (compute_array_index_type): Adjust prototype.
123 * semantics.c (constexpr_call): New datatype.
124 (constexpr_call_table): New global table.
125 (constexpr_call_hash): New.
126 (constexpr_call_equal): Likewise.
127 (maybe_initialize_constexpr_call_table): Likewise.
128 (lookup_parameter_binding): Likewise.
129 (cxx_eval_builtin_function_call): Likewise.
130 (cxx_bind_parameters_in_call): Likewise.
131 (cxx_eval_call_expression): Likewise.
132 (cxx_eval_unary_expression): Likewise.
133 (cxx_eval_binary_expression): Likewise.
134 (cxx_eval_conditional_expression): Likewise.
135 (cxx_eval_array_reference): Likewise.
136 (cxx_eval_component_reference): Likewise.
137 (cxx_eval_logical_expression): Likewise.
138 (cxx_eval_object_construction): Likewise.
139 (cxx_eval_constant_expression): Likewise.
140 (cxx_eval_indirect_ref): Likewise.
141 (cxx_constant_value): Likewise.
142 (cxx_eval_bare_aggregate): Likewise.
143 (adjust_temp_type): New.
144 (reduced_constant_expression_p): New.
145 (verify_constant): New.
146 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
147 (cxx_eval_outermost_constant_expr): New.
148 (maybe_constant_value, maybe_constant_init): New.
149 (cxx_eval_constant_expression): Use them.
150 * pt.c (iterative_hash_template_arg): No longer static.
151 * cp-tree.h: Declare fns.
153 * cp-tree.h (register_constexpr_fundef): Declare.
154 * decl.c (maybe_save_function_definition): New.
155 (finish_function): Use it.
156 * semantics.c (constexpr_fundef): New datatype.
157 (constexpr_fundef_table): New global table.
158 (constexpr_fundef_equal): New.
159 (constexpr_fundef_hash): Likewise.
160 (retrieve_constexpr_fundef): Likewise.
161 (validate_constexpr_fundecl): Store in the table.
162 (build_data_member_initialization): New fn.
163 (build_constexpr_constructor_member_initializers): New.
164 (register_constexpr_fundef): Define.
165 (is_this_parameter): New.
166 (get_function_named_in_call): Likewise.
167 (get_nth_callarg): Likewise.
168 (check_automatic_or_tls): New.
169 (morally_constexpr_builtin_function_p): New.
170 (potential_constant_expression): New.
172 2010-11-01 Jason Merrill <jason@redhat.com>
174 * decl2.c (decl_constant_var_p): New fn.
175 (decl_maybe_constant_var_p): New fn.
176 (mark_used): Rework instantiation of things needed for constant
178 * cp-tree.h: Declare new fns.
179 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
180 (always_instantiate_p): Use decl_maybe_constant_var_p.
181 (instantiate_decl): Don't defer constexpr functions.
182 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
183 * semantics.c (finish_id_expression): Use decl_constant_var_p.
184 Check for valid name in constant expr after mark_used.
186 2010-10-31 Jason Merrill <jason@redhat.com>
188 * class.c (is_really_empty_class): Work when type is not complete.
189 (synthesized_default_constructor_is_constexpr): New.
190 (add_implicitly_declared_members): Use it.
191 (type_has_constexpr_default_constructor): Likewise.
192 * cp-tree.h: Declare it.
193 * method.c (synthesized_method_walk): Use it.
195 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
196 * typeck.c (convert_for_assignment): Likewise.
198 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
199 message about constexpr without -std=c++0x.
201 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
204 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
206 * class.c (layout_vtable_decl): Call build_array_of_n_type.
207 (build_vtt, build_ctor_vtabl_group): Likewise.
209 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
211 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
212 * parser.c (cp_parser_objc_at_property_declaration): Removed
213 parsing of RID_COPIES and RID_IVAR. Updated call to
214 objc_add_property_declaration.
215 * typecheck.c (finish_class_member_access_expr): Call
216 objc_maybe_build_component_ref instead of objc_build_setter_call.
217 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
218 of objc_build_getter_call.
220 2010-10-27 Jason Merrill <jason@redhat.com>
222 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
223 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
224 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
225 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
226 (cp_parser_trait_expr): Likewise.
228 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
229 Jason Merrill <jason@redhat.com>
231 * decl.c (finish_case_label): Use decl_constant_value.
233 * method.c (synthesized_method_walk): Track constexprness too.
234 (process_subob_fn, walk_field_subobs): Likewise.
235 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
236 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
237 * class.c (add_implicitly_declared_members): Handle
238 constexpr default ctor.
240 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
241 Make sure a constexpr ctor has an empty body.
242 * class.c (type_has_constexpr_default_constructor): New.
243 * cp-tree.h: Declare it.
244 * init.c (perform_member_init): Complain about uninitialized
245 member in constexpr ctor.
246 (emit_mem_initializers): And uninitialized base.
247 * decl.c (check_tag_decl): Fix typo.
249 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
250 (is_valid_constexpr_fn): New fn.
251 (validate_constexpr_fundecl): Use it.
252 * decl.c (validate_constexpr_redeclaration): New.
253 (duplicate_decls): Use it.
254 (cp_finish_decl): Call validate_constexpr_fundecl and
255 ensure_literal_type_for_constexpr_object here.
256 (start_decl): Not here. Don't ICE on constexpr reference.
257 (check_for_uninitialized_const_var): Don't handle constexpr specially.
258 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
259 (check_static_variable_definition): Give friendly message about
261 (grokdeclarator): Complain about typedef and volatile with constexpr.
262 Reorganize. Give sorry about non-static data members in C++0x mode.
263 (start_preparsed_function): Check validate_constexpr_fundecl here.
264 (check_function_type): Not here.
265 * decl2.c (finish_static_data_member_decl): Don't complain about
267 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
268 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
269 (cp_parser_decl_specifier_seq): Handle it.
270 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
272 * class.c (check_bases): Propagate non-literality.
273 (check_field_decls): Likewise.
274 (finalize_literal_type_property): New.
275 (check_bases_and_members): Call it.
276 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
277 (lang_type_class): Add has_constexpr_ctor field.
278 (DECL_DECLARED_CONSTEXPR_P): Strip template.
279 * decl.c (grok_special_member_properties): Set
280 TYPE_HAS_CONSTEXPR_CTOR.
282 2010-10-27 Jason Merrill <jason@redhat.com>
284 * call.c (build_integral_nontype_arg_conv): New.
285 * cp-tree.h: Declare it.
286 * pt.c (convert_nontype_argument): Use it.
288 * error.c (dump_simple_decl): Print constexpr.
290 * cvt.c (build_up_reference): Use target_type for the temporary var.
292 * except.c (build_throw): Set EXPR_LOCATION.
294 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
296 * semantics.c (finish_compound_stmt): Avoid creating an
297 unnecessary BIND_EXPR.
299 * call.c (convert_like_real): Don't check narrowing if the element
300 is also an initializer-list.
302 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
304 * parser.c (cp_parser_objc_at_property_declaration): Recognize
305 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
306 Do not use objc_set_property_attr, but use local variables
307 instead. Detect repeated usage of setter, getter and ivar
308 attributes. Improved error processing when a setter name does not
309 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
310 that the token is a keyword. Updated call to
311 objc_add_property_declaration.
313 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
315 * parser.c (cp_parser_objc_property_decl): Renamed to
316 cp_parser_objc_struct_declaration. Return the parsed trees
317 instead of calling objc_add_property_variable directly. Detect
318 missing or invalid declspecs. Implemented attributes. Do not eat
319 the ';' at the end. Exit loop whenever a non-comma is parsed, not
321 (cp_parser_objc_at_property): Renamed to
322 cp_parser_objc_at_property_declaration. Updated calls to
323 objc_add_property_variable, now objc_add_property_declaration, and
324 to cp_parser_objc_property_decl, now
325 cp_parser_objc_struct_declaration. Rewritten all code to be more
326 robust in dealing with syntax errors, and almost identical to the
327 one in c_parser_objc_at_property_declaration.
328 (cp_parser_objc_property_attrlist): Removed.
329 (cp_parser_objc_method_prototype_list): Updated call to
330 cp_parser_objc_at_property.
331 (cp_parser_objc_method_definition_list): Same change.
332 (cp_parser_objc_class_ivars): Detect a number of invalid
333 declarations of instance variables and produce errors when they
336 2010-10-26 Jason Merrill <jason@redhat.com>
338 * tree.c (build_vec_init_expr): Split out from...
339 (build_array_copy): ...here.
340 * init.c (perform_member_init): Use it.
341 * cp-tree.h: Declare it.
342 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
343 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
344 (cp_gimplify_expr): Handle array default-initialization via
347 * tree.c (stabilize_expr): Handle xvalues properly.
349 * call.c (build_over_call): Use argarray[0] for 'this' argument.
351 * decl.c (finish_function): Don't look at function_depth.
353 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
355 Implement opaque-enum-specifiers for C++0x.
356 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
357 (OPAQUE_ENUM_P): New.
358 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
359 (start_enum): Update prototype.
360 (finish_enum_value_list): New prototype.
361 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
362 "enum class" is used in an elaborated-type-specifier.
363 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
364 * decl.c (copy_type_enum): New.
365 (finish_enum_value_list): New, with code from finish_enum.
366 (finish_enum): A lot of code removed. Added a gcc_assert.
367 (start_enum): Add parameters enumtype and is_new.
368 Rewrite to work with opaque-enum-specifiers.
369 * pt.c (maybe_process_partial_specialization): Allow for template
370 specialization of enumerations, with a pedwarn.
371 (lookup_template_class): Update call to start_enum. Call to
373 (tsubst_enum): Call to begin_scope, finish_scope and
374 finish_enum_value_list.
376 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
378 Removed Objective-C++ specific replacement of cxx_printable_name.
379 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
380 to cxx_printable_name for both C++ and Objective-C++.
381 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
383 * error.c (dump_decl): For Objective-C++, call
384 objc_maybe_printable_name here ...
385 * tree.c (cxx_printable_name_internal): ... instead of here.
387 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
389 * tree.c (cxx_printable_name_internal): In Objective-C++, call
390 objc_maybe_printable_name.
392 2010-10-22 Jason Merrill <jason@redhat.com>
395 * pt.c (instantiate_class_template): Don't instantiate default
399 * init.c (build_vec_init): Handle memberwise move.
401 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
404 * call.c (add_function_candidate): Don't use TREE_VALUE on null
407 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
409 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
410 bool instead of calling objc_set_method_type.
411 (cp_parser_objc_method_signature): Updated calls to
412 cp_parser_objc_method_type and to objc_build_method_signature.
413 (cp_parser_objc_method_prototype_list): Updated calls to
414 objc_add_method_declaration. Use token->type to determine if it
415 is a class method or not.
416 (cp_parser_objc_method_definition_list): Same change.
418 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
421 * parser.c (cp_convert_range_for): Call cp_finish_decl
422 instead of finish_expr_stmt.
424 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
426 * cp-lang.c (finish_file): Removed.
427 * decl2.c (cp_write_global_declarations): Call
428 objc_write_global_declarations when compiling Objective-C++.
430 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
433 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
434 (coerce_template_parms): Likewise for args.
436 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
438 Implemented parsing @synthesize and @dynamic for Objective-C++.
439 * parser.c (cp_parser_objc_method_definition_list): Recognize
440 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
441 (cp_parser_objc_at_dynamic_declaration): New.
442 (cp_parser_objc_at_synthesize_declaration): New.
444 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
446 * parser.c (cp_parser_objc_identifier_list): Check the return
447 value of cp_parser_identifier and react if it is error_mark_node.
449 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
451 Merge from apple/trunk branch on FSF servers.
453 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
456 * call.c (standard_conversion, implicit_conversion): Ignore
457 'volatile' attribute of artificially volatized type in objc when
458 evaluating various conversion weights.
460 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
463 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
464 artiificially 'volatized' type before doing pointer comparison.
466 2010-10-18 Jakub Jelinek <jakub@redhat.com>
469 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
472 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
474 Merge from apple/trunk branch on FSF servers.
476 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
479 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
480 objc object types if type is scope qualified.
482 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
484 Merge from apple/trunk branch on FSF servers.
486 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
489 * lex.c (unqualified_name_lookup_error): Issue diagnostic
490 for private 'ivar' access.
492 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
494 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
495 enum, and handle @package.
497 2010-10-15 Jason Merrill <jason@redhat.com>
500 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
501 with a different typedef variant of the element type.
503 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
505 merge from FSF apple 'trunk' branch.
506 2006 Fariborz Jahanian <fjahanian@apple.com>
508 Radars 4436866, 4505126, 4506903, 4517826
509 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
511 (cp_build_modify_expr): Likewise.
512 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
513 (cp_parser_objc_method_definition_list): Likewise.
514 (cp_parser_objc_property_decl): New.
515 (cp_parser_objc_property_attrlist): New.
516 (cp_parser_objc_at_property): New.
518 2010-10-14 Richard Guenther <rguenther@suse.de>
521 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
522 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
524 * error.c (dump_type): Handle NULLPTR_TYPE.
525 (dump_type_prefix): Likewise.
526 (dump_type_suffix): Likewise.
527 * mangle.c (write_type): Likewise.
528 * name-lookup.c (arg_assoc_type): Likewise.
529 * rtti.c (typeinfo_in_lib_p): Likewise.
530 * pt.c (tsubst): Likewise.
532 2010-10-13 Jason Merrill <jason@redhat.com>
535 * class.c (fixup_attribute_variants): New fn.
536 * cp-tree.h: Declare it.
537 * pt.c (instantiate_class_template): Call it.
538 * semantics.c (begin_class_definition): Call it.
540 2010-10-13 Richard Henderson <rth@redhat.com>
542 * cp-lang.c (cp_eh_personality): Update call to
543 build_personality_function.
544 * except.c (choose_personality_routine): Update function comment.
546 2010-10-13 Richard Guenther <rguenther@suse.de>
548 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
549 clear DECL_CHAIN of NAMESPACE_DECLs.
551 2010-10-11 Martin Jambor <mjambor@suse.cz>
554 * cp-tree.h (current_class_ref): Check that cp_function_chain is
556 * call.c (build_cxx_call): Likewise.
558 2010-10-10 Jason Merrill <jason@redhat.com>
560 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
561 (tsubst_default_arguments): Only do this once for cloned fns.
562 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
564 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
565 (tsubst_copy_and_build): Likewise.
566 (tsubst_initializer_list): Likewise.
567 (tsubst_copy): Change default to gcc_unreachable. Handle
568 OVERLOAD and PTRMEM_CST.
570 2010-10-10 Jason Merrill <jason@redhat.com>
574 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
576 2010-10-07 Andi Kleen <ak@linux.intel.com>
578 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
579 (cc1plus-dummy): Remove.
580 (cc1plus-checksum): Change to run checksum over object files
583 2010-10-08 Joseph Myers <joseph@codesourcery.com>
585 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
587 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
589 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
591 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
593 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
594 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
595 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
596 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
597 * parser.c (cp_parser_objc_encode_expression): Updated comment.
599 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
601 Merge from apple/trunk branch on FSF servers.
603 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
606 * parser.c (cp_parser_objc_interstitial_code): Recognize
607 and parse RID_NAMESPACE keyword.
609 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
611 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
612 finding ellipsis, before checking for attributes.
614 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
616 Merge from apple/trunk branch on FSF servers.
617 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
618 longer existing gcc/c-common.def.
620 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
623 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
624 * parser.c (cp_parser_objc_encode_expression): Build a templatized
625 parse tree for @encode(T).
627 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
630 * c-common.def: Add new expression code AT_ENCODE_EXPR.
632 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
635 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
636 code folding offsetof-like computations.
638 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
641 * parser.c (cp_parser_objc_class_interface): If no identifier
642 follows an @interface token, stop parsing the interface after
644 (cp_parser_objc_class_implementation): If no identifier follows an
645 @implementation token, stop parsing the implementation after
648 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
651 * parser.c (cp_parser_objc_method_keyword_params): If the required
652 colon is not found while parsing parameters, stop parsing them.
654 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
657 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
658 @end after detecting it. Print an error if @end is found without
660 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
661 detecting it. Fixed reading the next token when continuing
662 because of an error in a method signature. Print an error if EOF
663 is found without an '@end'.
664 (cp_parser_objc_method_definition_list): Same change.
666 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
668 Merge from apple/trunk branch on FSF servers:
670 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
673 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
674 method parameters and issue error.
675 (cp_parser_objc_method_definition_list): Check for invalid tokens
676 which cannot start a function definition.
678 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
681 * parser.c (cp_parser_objc_message_args): Check for missing message
682 arguments and syntax error.
684 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
687 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
690 2005-08-15 Ziemowit Laski <zlaski@apple.com>
693 * parser.c (cp_parser_objc_interstitial_code): Catch stray
694 '{' and '}' tokens and issue appropriate errors.
696 2005-08-02 Ziemowit Laski <zlaski@apple.com>
699 (cp_parser_statement_seq_opt): In addition to '}' and
700 end-of-file, a statement sequence may also be terminated
703 2010-10-05 Joseph Myers <joseph@codesourcery.com>
705 * cp-tree.h (cxx_print_error_function,
706 cxx_initialize_diagnostics): Declare using diagnostic_context
709 2010-10-04 Andi Kleen <ak@linux.intel.com>
711 * Make-lang.in (g++, cc1plus): Add + to build rule.
713 2010-10-04 Jason Merrill <jason@redhat.com>
715 * tree.c (decl_storage_duration): New.
716 * cp-tree.h: Declare it.
717 (duration_kind): Return values.
719 2010-10-03 Jason Merrill <jason@redhat.com>
721 * typeck.c (require_complete_type_sfinae): Add complain parm to...
722 (require_complete_type): ...this function.
723 (cp_build_array_ref, convert_arguments): Use it.
724 (convert_for_initialization, cp_build_modify_expr): Likewise.
725 * cp-tree.h: Declare it.
726 * call.c (build_over_call): Use it.
728 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
730 merge from FSF 'apple/trunk' branch.
731 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
734 * cp/parser.c (cp_parser_objc_interstitial_code): For
735 @optional/@required set the optional/required flag.
737 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
739 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
740 and indentation when finding an Objective-C++ CPP_AT_NAME token.
742 2010-09-29 Richard Guenther <rguenther@suse.de>
744 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
745 (CP_TYPE_CONTEXT): Similar.
746 (FROB_CONTEXT): Frob global_namespace to the global
747 TRANSLATION_UNIT_DECL.
748 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
749 set DECL_CONTEXT of global_namespace to it.
750 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
751 instead of zeroing context.
752 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
753 (grokfndecl): Likewise.
754 (start_preparsed_function): Likewise.
755 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
756 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
757 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
758 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
759 (push_template_decl_real): Likewise.
760 (tsubst_friend_class): Likewise. Adjust context comparisons.
761 (instantiate_class_template): Use CP_TYPE_CONTEXT.
762 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
763 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
766 2010-09-29 Yao Qi <yao@codesourcery.com>
768 * decl.c (get_atexit_node): Fix typo.
770 2010-09-28 Jason Merrill <jason@redhat.com>
772 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
773 (real_lvalue_p): Take const_tree.
775 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
776 (cp_build_addr_expr_1): Likewise.
778 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
780 Partially merged from apple/trunk branch on FSF servers:
781 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
782 Radar 3803157 (method attributes)
784 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
785 (cp_parser_objc_method_tail_params_opt): Likewise.
786 (cp_parser_objc_method_signature): Likewise.
787 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
788 (cp_parser_objc_method_prototype_list): Handle attributes.
789 (cp_parser_objc_method_definition_list): Likewise.
791 2010-09-28 Richard Henderson <rth@redhat.com>
793 * cp-lang.c: Include "target.h".
794 (cp_eh_personality): Use targetm.except_unwind_info.
795 * Make-lang.in (cp-lang.o): Update deps.
797 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
799 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
800 (cp_parser_declaration): Parse prefix attributes for ObjC++.
801 (cp_parser_objc_protocol_declaration): Handle attributes.
802 (cp_parser_objc_class_interface): Likewise.
803 (cp_parser_objc_declaration): Likewise.
805 2010-09-27 Jason Merrill <jason@redhat.com>
807 Require lvalues as specified by the standard.
808 * typeck.c (lvalue_or_else): Use real_lvalue_p.
809 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
810 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
811 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
812 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
813 (build_const_cast_1): Adjust.
814 * cp-tree.h: Declare new fns.
815 * call.c (build_this, convert_like_real, build_over_call): Adjust.
816 (initialize_reference): Adjust.
817 * class.c (build_base_path, convert_to_base_statically): Adjust.
818 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
819 * cvt.c (build_up_reference, convert_to_reference): Adjust.
820 * decl.c (register_dtor_fn): Adjust.
821 * decl2.c (build_offset_ref_call_from_tree): Adjust.
822 * except.c (initialize_handler_parm): Adjust.
823 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
824 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
825 * tree.c (stabilize_expr): Adjust.
827 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
829 Merge from apple/trunk branch on FSF servers:
831 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
834 * typeck.c (composite_pointer_type): Call objc_have_common_type
835 when comparing two objective-c pointer types.
837 2005-07-18 Ziemowit Laski <zlaski@apple.com>
840 * call.c (standard_conversion): Do not issue warnings when
841 comparing ObjC pointer types.
843 2005-06-22 Ziemowit Laski <zlaski@apple.com>
846 * call.c (standard_conversion): Allow for a pointer conversion
847 between any two ObjC pointer types.
848 * typeck.c (composite_pointer_type): Determine common type
849 for two ObjC pointer types.
851 2010-09-24 Jan Hubicka <jh@suse.cz>
853 * decl.c (finish_function): Use decl_replaceable_p
854 * method.c (make_alias_for_thunk): Update call of
855 cgraph_same_body_alias.
857 2010-09-24 Jason Merrill <jason@redhat.com>
859 * decl.c (compute_array_index_type): Remember type dependence of
861 * pt.c (dependent_type_p_r): Don't recompute it here.
863 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
864 reference and pointer to the same type as "*" or "&".
866 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
868 * typeck.c (warn_args_num): Use warning 'too many arguments to
869 method [methodname]' for an Objective-C method instead of the less
870 satisfactory 'too many arguments to function' (with no method
873 2010-09-21 Jason Merrill <jason@redhat.com>
875 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
876 special handling if we know the member.
878 2010-09-18 Jason Merrill <jason@redhat.com>
880 * call.c (compare_ics): Do lvalue/rvalue reference binding
881 comparison for ck_list, too.
883 2010-09-15 Jason Merrill <jason@redhat.com>
885 * semantics.c (finish_id_expression): Diagnose use of function
886 parms in evaluated context outside function body.
888 * decl2.c (grokbitfield): Diagnose non-integral width.
890 * call.c (convert_like_real): Use the underlying type of the
891 reference for the temporary.
893 2010-09-15 Jakub Jelinek <jakub@redhat.com>
896 * class.c (build_vtbl_initializer): Use fn instead of init's operand
897 as first argument to FDESC_EXPR.
899 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
902 * decl.c (grokdeclarator): Check build_memfn_type return value
905 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
907 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
908 (begin_range_for_stmt): Likewise.
910 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
912 Implement range-based for-statements.
913 * cp-tree.def (RANGE_FOR_STMT): New.
914 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
915 (cp_convert_range_for): Declare.
916 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
917 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
918 * semantics.c (begin_range_for_stmt): New.
919 (finish_range_for_decl): New.
920 (finish_for_stmt): Accept also RANGE_FOR_STMT.
921 (perform_koenig_lookup): Add extra argument include_std.
922 * parser.c (cp_parser_c_for): New with code from
923 cp_parser_iteration_statement().
924 (cp_parser_range_for): New.
925 (cp_convert_range_for): New.
926 (cp_parser_iteration_statement): Add range-for support.
927 (cp_parser_condition): Adjust comment.
928 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
930 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
931 * cxx-pretty-print.c: Likewise.
932 * lex.c (cxx_init): Likewise.
933 * name-lookup.c (lookup_function_nonclass): Add extra argument
935 (lookup_arg_dependent): Likewise.
936 * name-lookup.h: Likewise.
938 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
941 * error.c (maybe_warn_cpp0x): Add new warning
942 CPP0X_INLINE_NAMESPACES.
943 * parser.c (cp_parser_namespace_definition): Likewise.
944 * cp-tree.h (cpp0x_warn_str): Likewise.
946 2010-09-10 Richard Guenther <rguenther@suse.de>
948 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
949 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
951 2010-09-10 Jan Hubicka <jh@suse.cz>
953 PR tree-optimization/45605
954 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
957 2010-09-08 Jakub Jelinek <jakub@redhat.com>
960 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
961 before calling fold_decl_constant_value.
963 2010-09-07 Arnaud Charlet <charlet@adacore.com>
965 * cp-tree.h (build_enumerator): Add new location_t parameter.
966 (build_lang_decl_loc): New function.
967 * decl.c (build_enumerator): New parameter loc. Use it when calling
968 build_decl. Replace build_lang_decl with build_lang_decl_loc.
969 * pt.c (tsubst_enum): Adjust call to build_enumerator.
970 * parser.c (cp_parser_enumerator_definition): Ditto.
971 * lex.c (build_lang_decl_loc): New function.
973 2010-09-06 Dodji Seketeli <dodji@redhat.com>
978 * tree.c (strip_typedefs): Strip typedefs from the context of
981 2010-09-06 Mark Mitchell <mark@codesourcery.com>
983 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
984 * call.c (build_conditional_expr): Likewise.
985 (convert_arg_to_ellipsis): Likewise.
987 2010-09-06 Arnaud Charlet <charlet@adacore.com>
989 * parser.c (make_pointer_declarator, make_reference_declarator,
990 make_call_declarator, make_array_declarator): Set declarator->id_loc.
991 (cp_parser_init_declarator): Adjust location of decl if appropriate.
993 2010-09-06 Jason Merrill <jason@redhat.com>
995 * call.c (implicit_conversion): Fix value-init of enums.
996 (convert_like_real): Likewise.
998 * decl.c (cp_finish_decl): Don't change init for auto deduction.
1000 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
1001 (fold_non_dependent_expr): ...here.
1002 (convert_nontype_argument): Use it. Take complain parm.
1003 Use perform_implicit_conversion instead of ocp_convert.
1004 Allow cv-qual changes.
1005 (convert_template_argument): Pass complain down.
1006 (tsubst_template_arg): Suppress constant expression warnings.
1009 * method.c (synthesized_method_walk): In constructors, also check
1010 subobject destructors.
1012 * semantics.c (finish_compound_literal): Always build a
1015 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
1018 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
1020 2010-08-30 Jakub Jelinek <jakub@redhat.com>
1023 * parser.c (cp_parser_omp_atomic): Handle boolean
1024 {PRE,POST}_INCREMENT.
1026 2010-08-29 Jason Merrill <jason@redhat.com>
1029 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
1030 after tentative parsing.
1032 2010-08-22 Joseph Myers <joseph@codesourcery.com>
1034 * Make-lang.in (g++spec.o): Update dependencies.
1035 * g++spec.c: Include opts.h
1036 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
1037 (lang_specific_driver): Use cl_decoded_option structures.
1039 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
1041 * call.c: Use FOR_EACH_VEC_ELT.
1042 * class.c: Likewise.
1044 * decl2.c: Likewise.
1045 * error.c: Likewise.
1046 * except.c: Likewise.
1047 * mangle.c: Likewise.
1048 * method.c: Likewise.
1049 * name-lookup.c: Likewise.
1050 * parser.c: Likewise.
1053 * semantics.c: Likewise.
1054 * typeck2.c: Likewise.
1056 2010-08-19 Jason Merrill <jason@redhat.com>
1058 * call.c (reference_related_p): Check for error_mark_node.
1059 (add_function_candidate): Check it instead of
1060 same_type_ignoring_top_level_qualifiers_p.
1063 * init.c (build_new_1): Don't use build_value_init in a template.
1064 (build_value_init): Make sure we don't.
1067 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1068 of empty class CONSTRUCTOR.
1070 * except.c (pending_noexcept, pending_noexcept_checks): New.
1071 (perform_deferred_noexcept_checks): New.
1072 (maybe_noexcept_warning): Split from...
1073 (finish_noexcept_expr): ...here. Adjust.
1074 * decl2.c (cp_write_global_declarations): Call
1075 perform_deferred_noexcept_checks.
1076 * cp-tree.h: And declare it.
1078 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1081 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1084 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1086 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1087 or if -fms-extensions is enabled check, check permissive.
1089 2010-08-09 Jason Merrill <jason@redhat.com>
1092 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1094 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1096 * call.c (add_builtin_candidates): Use VECs for local variable
1097 `types'. Adjust remainder of function accordingly.
1099 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1101 * name-lookup.c (is_associated_namespace): Convert local variables
1102 to be VECs instead of TREE_LISTs.
1104 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1106 * tree.c (varargs_function_p): Use stdarg_p.
1108 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1110 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1111 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1112 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1113 Change type to a VEC.
1114 (unparsed_funs_with_default_args): Define.
1115 (unparsed_funs_with_definitions): Define.
1116 (push_unparsed_function_queues): New function.
1117 (cp_parser_new): Call it.
1118 (pop_unparsed_function_queues): New function.
1119 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1120 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1121 (cp_parser_save_member_function_body): Likewise.
1122 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1123 and pop_unparsed_function_queues.
1124 (cp_parser_late_parsing_default_args): Likewise.
1125 (cp_parser_save_default_args): Use VEC_safe_push.
1127 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1129 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1131 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1133 * decl.c (poplevel): Adjust for type changes.
1134 (declare_local_label): Likewise.
1136 2010-08-06 Jason Merrill <jason@redhat.com>
1138 * typeck.c (complete_type_or_maybe_complain): Split out from...
1139 (complete_type_or_else): Here.
1140 (build_class_member_access_expr): Call it.
1141 (finish_class_member_access_expr): Likewise.
1142 * call.c (build_special_member_call): Likewise.
1143 * cvt.c (build_expr_type_conversion): Likewise.
1144 * init.c (build_new): Likewise.
1145 * typeck2.c (build_functional_cast): Likewise.
1146 * cp-tree.h: Declare it.
1148 * init.c (build_value_init): Add complain parm.
1149 (build_value_init_noctor): Likewise.
1150 (perform_member_init): Pass it.
1151 (expand_aggr_init_1): Likewise.
1152 (build_new_1): Likewise.
1153 (build_vec_init): Likewise.
1154 * pt.c (tsubst_expr): Likewise.
1155 * typeck2.c (build_functional_cast): Likewise.
1156 * cp-tree.h: Adjust.
1157 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1159 * typeck.c (decay_conversion): Any expression with type nullptr_t
1162 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1165 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1167 2010-07-27 Jason Merrill <jason@redhat.com>
1169 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1170 from build_value_init.
1171 * init.c (build_value_init_noctor): Give error for unknown array
1174 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1176 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1178 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1180 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1181 c_common_initialize_diagnostics.
1182 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1183 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1185 2010-07-21 Jason Merrill <jason@redhat.com>
1187 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1189 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1192 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1195 * pt.c (instantiate_class_template): Propagate the template's
1196 location to its instance.
1198 2010-07-20 Jason Merrill <jason@redhat.com>
1201 * pt.c (tsubst_copy_and_build): Rework last change.
1204 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1207 2010-07-19 Jason Merrill <jason@redhat.com>
1210 * semantics.c (finish_decltype_type): Correct decltype
1211 of parenthesized rvalue reference variable.
1214 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1215 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1217 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1220 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1222 * cp-tree.h: Adjust declaration.
1223 * init.c (perform_member_init): Adjust caller.
1224 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1225 * typeck2.c (store_init_value): Likewise.
1226 (build_functional_cast): Pass complain argument to
1227 build_x_compound_expr_from_list.
1229 2010-07-16 Jason Merrill <jason@redhat.com>
1232 * pt.c (process_partial_specialization): Diagnose partial
1233 specialization after instantiation.
1234 (most_specialized_class): Add complain parm.
1236 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1238 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1240 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1241 cp_build_function_call.
1243 2010-07-15 Jason Merrill <jason@redhat.com>
1246 * call.c (add_function_candidate): If we're working on an implicit
1247 declaration, don't consider candidates that won't match.
1248 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1249 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1252 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1253 (TYPE_HAS_USER_OPEQ): New.
1254 * decl.c (grok_special_member_properties): Set it.
1255 * class.c (add_implicitly_declared_members): Don't lazily declare
1256 constructors/operator= if a base or member has a user-declared one.
1257 (check_bases_and_members, check_bases): Adjust.
1258 (check_field_decls, check_field_decl): Adjust.
1260 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1262 * decl.c (integer_three_node): Remove.
1263 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1264 * cp-tree.h (integer_three_node): Remove.
1266 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1268 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1270 * class.c: Likewise.
1271 * cp-gimplify.c: Likewise.
1273 * decl2.c: Likewise.
1275 * mangle.c: Likewise.
1276 * name-lookup.c: Likewise.
1277 * optimize.c: Likewise.
1278 * parser.c: Likewise.
1281 * search.c: Likewise.
1282 * semantics.c: Likewise.
1283 * typeck.c: Likewise.
1284 * typeck2.c: Likewise.
1286 2010-07-14 Jason Merrill <jason@redhat.com>
1288 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1289 (build_field_list): Cache field type.
1291 Implement C++0x unrestricted unions (N2544)
1292 * class.c (check_field_decl): Loosen union handling in C++0x.
1293 * method.c (walk_field_subobs): Split out from...
1294 (synthesized_method_walk): ...here. Set msg before loops.
1295 (process_subob_fn): Check for triviality in union members.
1296 * init.c (sort_mem_initializers): Splice out uninitialized
1297 anonymous unions and union members.
1298 (push_base_cleanups): Don't automatically destroy anonymous unions
1301 2010-07-13 Jason Merrill <jason@redhat.com>
1304 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1305 (TYPE_HAS_USER_OPEQ): New.
1306 * decl.c (grok_special_member_properties): Set it.
1307 * class.c (add_implicitly_declared_members): Don't lazily declare
1308 constructors/operator= if a base or member has a user-declared one.
1309 (check_bases_and_members, check_bases): Adjust.
1310 (check_field_decls, check_field_decl): Adjust.
1311 * method.c (synthesized_method_walk): Initialize check_vdtor.
1314 * mangle.c (write_type): Canonicalize.
1315 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1316 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1318 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1321 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1323 * typeck.c (get_delta_difference): Update prototype, add a
1324 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1325 add checks for error_mark_node.
1326 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1327 parameter; update lookup_base call.
1328 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1329 parameter; update get_delta_difference call and add check for
1331 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1332 parameter; update get_delta_difference call and add check for
1333 error_mark_node; update build_ptrmemfunc call.
1334 (build_static_cast_1): Adjust convert_ptrmem call.
1335 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1336 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1337 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1338 and build_ptrmemfunc calls.
1339 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1341 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1344 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1345 adjust build_special_member_call call, pass complain.
1346 (convert_like_real): Adjust build_temp call, pass complain.
1348 2010-07-09 Jason Merrill <jason@redhat.com>
1351 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1352 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1353 Set BV_LOST_PRIMARY.
1354 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1356 2010-07-08 Jason Merrill <jason@redhat.com>
1359 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1360 virtual bases for covariant thunks.
1362 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1364 * cp-tree.h: Do not include toplev.h.
1366 2010-07-06 Jason Merrill <jason@redhat.com>
1369 * call.c (is_std_init_list): Look through typedefs.
1372 * init.c (build_offset_ref): If scope isn't dependent,
1373 don't exit early. Look at TYPE_MAIN_VARIANT.
1374 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1376 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1378 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1380 * cp-tree.h (impl_conv_void): New type.
1381 (convert_to_void): Adjust prototype.
1382 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1383 diagnostic for easy translation. Change caller.
1384 * typeck.c: Update call to convert_to_void.
1385 * semantics.c: Likewise.
1388 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1390 * decl.c (cp_finish_decl): Call add_local_decl.
1391 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1393 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1395 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1398 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1401 * parser.c (cp_parser_primary_expression): Error if local template is
1404 2010-07-02 Le-Chun Wu <lcwu@google.com>
1407 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1408 (variable or type) shadows another type.
1410 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1413 * typeck.c (convert_for_assignment): When converting a convertible
1414 vector type or objc++ types, call mark_rvalue_use.
1415 * typeck2.c (build_m_component_ref): Use return values from
1416 mark_rvalue_use or mark_lvalue_use.
1417 * class.c (build_base_path): Likewise.
1418 * call.c (build_conditional_expr): Likewise.
1420 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1423 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1426 2010-07-01 Richard Guenther <rguenther@suse.de>
1428 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1429 predicate we are looking for, allow non-gimplified
1432 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1435 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1436 arg is NULL_TREE too.
1437 * call.c (convert_class_to_reference): Return error_mark_node when
1440 2010-06-30 Michael Matz <matz@suse.de>
1442 * repo.c (finish_repo): Fix typo.
1444 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1446 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1448 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1450 * repo.c (pending_repo): Change type to a VEC.
1451 (finish_repo): Adjust for new type of pending_repo.
1452 (repo_emit_p): Likewise.
1454 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1456 * tree.c: Include gimple.h. Do not include tree-flow.h
1457 * decl.c: Do not include tree-flow.h
1458 * Make-lang.in: Adjust dependencies.
1460 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1462 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1463 (incomplete_vars): Adjust comment. Change type to a VEC.
1464 (maybe_register_incomplete_var): Adjust for new type.
1465 (complete_vars): Adjust iteration over incomplete_vars.
1467 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1469 * decl.c (struct named_label_entry): Change type of bad_decls field
1471 (poplevel_named_label_1): Adjust for new type of bad_decls.
1472 (check_goto): Likewise.
1474 2010-06-29 Jason Merrill <jason@redhat.com>
1476 Enable implicitly declared move constructor/operator= (N3053).
1477 * class.c (add_implicitly_declared_members): A class with no
1478 explicitly declared copy or move constructor gets both declared
1479 implicitly, and similarly for operator=.
1480 (check_bases): A type with no copy ctor does not inhibit
1481 a const copy ctor in a derived class. It does mean the derived
1483 (check_field_decl): Likewise.
1484 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1485 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1486 (trivially_copyable_p): Likewise.
1487 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1488 * class.c (finish_struct_bits): Likewise.
1489 * tree.c (build_target_expr_with_type): Likewise.
1490 * typeck2.c (store_init_value): Likewise.
1492 Enable implicitly deleted functions (N2346)
1493 * class.c (check_bases_and_members): Adjust lambda flags.
1494 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1496 * decl2.c (mark_used): Adjust error for use of deleted function.
1498 Machinery to support implicit delete/move.
1499 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1500 has_complex_move_ctor, has_complex_move_assign bitfields.
1501 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1502 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1503 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1504 (enum special_function_kind): Add sfk_move_assignment.
1505 (LOOKUP_SPECULATIVE): New.
1506 * call.c (build_over_call): Return early if it's set.
1507 (build_over_call): Use trivial_fn_p.
1508 * class.c (check_bases): If the base has no default constructor,
1509 the derived one is non-trivial. Handle move ctor/op=.
1510 (check_field_decl): Likewise.
1511 (check_bases_and_members): Handle move ctor/op=.
1512 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1513 (type_has_move_constructor, type_has_move_assign): New.
1514 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1515 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1516 (trivial_fn_p): New.
1517 (do_build_copy_constructor): Use it.
1518 (do_build_assign_ref): Likewise. Handle move assignment.
1519 (build_stub_type, build_stub_object, locate_fn_flags): New.
1520 (locate_ctor): Use locate_fn_flags.
1521 (locate_copy, locate_dtor): Remove.
1522 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1523 (process_subob_fn, synthesized_method_walk): New.
1524 (maybe_explain_implicit_delete): New.
1525 (implicitly_declare_fn): Use synthesized_method_walk,
1526 type_has_trivial_fn, and type_set_nontrivial_flag.
1527 (defaulted_late_check): Set DECL_DELETED_FN.
1528 (defaultable_fn_check): Handle sfk_move_assignment.
1529 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1530 implicitly deleted move ctor/op=.
1531 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1532 (lookup_fnfields_slot): New.
1533 * semantics.c (omp_clause_info_fndecl): Remove.
1534 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1535 get_copy_assign, trivial_fn_p.
1536 (trait_expr_value): Adjust call to locate_ctor.
1537 * tree.c (special_function_p): Handle sfk_move_assignment.
1539 * class.c (type_has_virtual_destructor): New.
1540 * cp-tree.h: Declare it.
1541 * semantics.c (trait_expr_value): Use it.
1543 * call.c (build_over_call): Only give warnings with tf_warning.
1545 * name-lookup.c (pop_scope): Handle NULL_TREE.
1547 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1548 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1549 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1550 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1551 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1552 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1553 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1554 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1555 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1556 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1557 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1558 * search.c, semantics.c, tree.c: Adjust.
1560 * pt.c (dependent_scope_ref_p): Remove.
1561 (value_dependent_expression_p): Don't call it.
1562 (type_dependent_expression_p): Here either.
1563 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1564 if the scope isn't dependent.
1566 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1570 * pt.c (has_value_dependent_address): New.
1571 (value_dependent_expression_p): Check it.
1572 (convert_nontype_argument): Likewise. Call decay_conversion before
1573 folding if we want a pointer.
1574 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1575 scope is the current instantiation.
1577 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1580 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1583 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1585 * init.c: Do not include except.h.
1588 * cp-lang.c: Likewise.
1590 * semantics.c: Likewise.
1591 * decl2.c: Likewise.
1592 * except.c: Likewise.
1593 (init_exception_processing): Do not set the removed
1594 lang_protect_cleanup_actions here.
1595 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1596 (doing_eh): New, moved from except.c but removed the do_warning flag.
1597 (expand_start_catch_block): Update doing_eh call.
1598 (expand_end_catch_block): Likewise.
1599 (build_throw): Likewise.
1600 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1601 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1602 cp_protect_cleanup_actions.
1603 * Make-lang.in: Update dependencies.
1605 2010-06-26 Jason Merrill <jason@redhat.com>
1607 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1608 constructor called with a single argument that takes a reference
1609 to the constructor's class.
1610 (BAD_CONVERSION_RANK): New.
1611 (compare_ics): Use it to compare bad ICSes.
1613 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1615 * lang-specs.h: Remove +e handling.
1617 2010-06-24 Andi Kleen <ak@linux.intel.com>
1619 * parser.c: (cp_parser_question_colon_clause):
1620 Switch to use cp_lexer_peek_token.
1621 Call warn_for_omitted_condop. Call pedwarn for omitted
1624 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1627 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1628 datum and mark_rvalue_use on component.
1631 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1632 the CALL_EXPR has no arguments.
1634 2010-06-21 Jason Merrill <jason@redhat.com>
1636 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1638 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1641 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1643 * name-lookup.c (struct arg_lookup): Convert namespaces and
1644 classes fields to VEC.
1645 (arg_assoc_namespace): Adjust for new type of namespaces.
1646 (arg_assoc_class): Adjust for new type of classes.
1647 (lookup_arg_dependent): Use make_tree_vector and
1648 release_tree_vector.
1649 * typeck2.c (build_x_arrow): Use vec_member.
1651 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1654 * error.c (dump_decl): Better wording for anonymous namespace.
1656 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1658 * class.c (build_vtbl_initializer): Adjust computation of new_position
1659 and which entry to add padding for.
1661 2010-06-16 Jason Merrill <jason@redhat.com>
1663 * except.c (check_noexcept_r): Return the problematic function.
1664 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1665 * pt.c (tsubst_copy_and_build): Pass it.
1666 * parser.c (cp_parser_unary_expression): Likewise.
1667 * cp-tree.h: Adjust prototype.
1669 * method.c (defaulted_late_check): Give the defaulted method
1670 the same exception specification as the implicit declaration.
1672 2010-06-15 Jason Merrill <jason@redhat.com>
1674 * class.c (add_implicitly_declared_members): Implicit assignment
1675 operators can also be virtual overriders.
1676 * method.c (lazily_declare_fn): Likewise.
1678 * call.c (convert_like_real): Give "initializing argument of"
1679 information for ambiguous conversion. Give source position
1682 * call.c (print_z_candidates): Do print viable deleted candidates.
1683 (joust): Don't choose a deleted function just because its worst
1684 conversion is better than another candidate's worst.
1686 * call.c (convert_like_real): Don't complain about
1687 list-value-initialization from an explicit constructor.
1689 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1690 DECL_SOURCE_LOCATION directly.
1692 * class.c (type_has_user_provided_default_constructor): Use
1695 * call.c (is_subseq): Handle ck_aggr, ck_list.
1696 (compare_ics): Treat an aggregate or ambiguous conversion to the
1697 same type as involving the same function.
1699 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1701 * typeck.c (convert_for_assignment): Fix comment. Change message
1702 format from %d to %qP.
1703 (convert_for_initialization): Fix comment.
1705 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1707 * cp-tree.h (expr_list_kind): New type.
1708 (impl_conv_rhs): New type.
1709 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1711 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1712 diagnostics for easy translation. Change caller.
1713 (convert_for_initialization): Use impl_conv_rhs and change caller.
1714 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1715 diagnostics for easy translation. Change caller.
1716 * decl.c (bad_spec_place): New enum.
1717 (bad_specifiers): Use it and emit the diagnostics for easy
1718 translation. Change caller.
1719 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1721 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1723 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1725 * decl2.c (cp_write_global_declarations): Adjust for new type of
1726 decl_namespace_list.
1727 * name-lookup.c (current_decl_namespace): Likewise.
1728 (push_decl_namespace): Likewise.
1729 (pop_decl_namespace): Likewise.
1731 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1733 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1734 instead of build_function_type.
1735 * decl.c (cxx_init_decl_processing): Likewise.
1736 (declare_global_var): Likewise.
1737 (get_atexit_node): Likewise.
1738 (expand_static_init): Likewise.
1739 * decl2.c (start_objects): Likewise.
1740 (start_static_storage_duration_function): Likewise.
1741 * except.c (init_exception_processing): Likewise.
1742 (build_exc_ptr): Likewise.
1743 (build_throw): Likewise.
1744 * rtti.c (throw_bad_cast): Likewise.
1745 (throw_bad_typeid): Likewise.
1746 (build_dynamic_cast_1): Likewise.
1748 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1750 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1751 (build_op_delete_call): Likewise.
1752 (build_over_call): Likewise.
1753 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1754 * pt.c (process_partial_specialization): Likewise.
1755 (tsubst_template_args): Likewise.
1756 * semantics.c (finish_asm_stmt): Likewise.
1758 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1760 * decl.c (record_key_method_defined): New, broken out of ...
1761 (finish_function): ... here. Call it.
1762 (start_decl): Treat aliases as definitions.
1764 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1766 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1768 * pt.c (maybe_process_partial_specialization): Likewise.
1769 (register_specialization): Likewise.
1770 (add_pending_template): Likewise.
1771 (lookup_template_class): Likewise.
1772 (push_tinst_level): Likewise.
1774 * parser.c (cp_lexer_new_main): Likewise.
1775 (cp_lexer_new_from_tokens): Likewise.
1776 (cp_token_cache_new): Likewise.
1777 (cp_parser_context_new): Likewise.
1778 (cp_parser_new): Likewise.
1779 (cp_parser_nested_name_specifier_opt): Likewise.
1780 (cp_parser_template_id): Likewise.
1782 * name-lookup.c (binding_entry_make): Likewise.
1783 (binding_table_construct): Likewise.
1784 (binding_table_new): Likewise.
1785 (cxx_binding_make): Likewise.
1786 (pushdecl_maybe_friend): Likewise.
1787 (begin_scope): Likewise.
1788 (push_to_top_level): Likewise.
1790 * lex.c (init_reswords): Likewise.
1791 (retrofit_lang_decl): Likewise.
1792 (cxx_dup_lang_specific_decl): Likewise.
1793 (copy_lang_type): Likewise.
1794 (cxx_make_type): Likewise.
1796 * decl.c (make_label_decl): Likewise.
1797 (check_goto): Likewise.
1798 (start_preparsed_function): Likewise.
1799 (save_function_data): Likewise.
1801 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1803 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1805 * class.c (finish_struct_1): Likewise.
1807 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1808 (struct lang_decl): Likewise.
1810 * parser.c (cp_parser_new): Update comment to not reference
1813 2010-06-07 Jason Merrill <jason@redhat.com>
1816 * error.c (dump_parameters): Mask out TFF_SCOPE.
1817 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1818 (dump_scope): Remove no-op mask.
1821 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1823 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1824 * init.c (build_offset_ref): Use it.
1825 * pt.c (maybe_process_partial_specialization): Use it.
1826 (instantiate_class_template): Use it.
1827 * search.c (lookup_base): Use it.
1829 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1832 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1833 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1834 handled_component_p.
1837 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1838 set also DECL_READ_P on the decl.
1840 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1843 * cp-tree.h (typedef_variant_p): Move this declaration to
1845 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1846 * decl.c (grokdeclarator): Do not rename debug info of an
1847 anonymous tagged type named by a typedef.
1849 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1852 * class.c (check_field_decls): Move the call to
1853 check_bitfield_decl before trying to set the
1854 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1856 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1858 * typeck.c: Update include path for moved files.
1861 * cp-gimplify.c: Likewise.
1862 * cp-lang.c: Likewise.
1864 * semantics.c: Likewise.
1865 * cxx-pretty-print.h: Likewise.
1866 * decl2.c: Likewise.
1867 * parser.c: Likewise.
1868 * cp-objcp-common.c: Likewise.
1869 * cp-tree.h: Likewise.
1870 * name-lookup.c: Likewise.
1872 * name-lookup.h: Likewise.
1873 * config-lang.in: Update paths in gtfiles for files in c-family/.
1874 * Make-lang.in: Likewise.
1876 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1878 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1879 * typeck.c (build_ptrmemfunc): Likewise.
1881 2010-06-04 Jason Merrill <jason@redhat.com>
1883 * typeck2.c (merge_exception_specifiers): Adjust merging of
1884 throw() and noexcept(true).
1886 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1887 using an uninitialized variable.
1889 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1890 (pp_cxx_expression): Likewise.
1892 Implement noexcept-specification (15.4)
1893 * parser.c (cp_parser_exception_specification_opt): Parse it.
1894 Give -Wdeprecated warning about throw() specs.
1895 * pt.c (tsubst_exception_specification): Handle it.
1896 * error.c (dump_exception_spec): Handle it.
1897 (dump_expr): Handle NOEXCEPT_EXPR.
1898 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1899 * typeck.c (comp_except_specs): Handle compatibility rules.
1900 Change exact parm to take an enum.
1901 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1902 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1903 (type_throw_all_p, build_noexcept_spec): New fns.
1904 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1905 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1906 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1907 (noexcept_true_spec, noexcept_false_spec): New macros.
1908 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1909 * search.c (check_final_overrider): Adjust.
1910 * decl.c (check_redeclaration_exception_specification): Adjust.
1911 (use_eh_spec_block): Use type_throw_all_p.
1912 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1913 Give operator new a noexcept-specification in C++0x mode.
1914 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1915 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1917 Implement noexcept operator (5.3.7)
1918 * cp-tree.def (NOEXCEPT_EXPR): New.
1919 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1920 * cp-tree.h: Declare finish_noexcept_expr.
1921 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1922 * pt.c (tsubst_copy_and_build): And tsubst it.
1923 (type_dependent_expression_p): Handle it.
1924 (value_dependent_expression_p): Handle it.
1926 * call.c (build_conditional_expr): Never fold in unevaluated context.
1927 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1928 * semantics.c (simplify_aggr_init_expr): Likewise.
1929 * typeck.c (merge_types): Call merge_exception_specifiers.
1930 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1931 DECL_ANTICIPATED for preferring new type.
1933 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1935 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1938 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1941 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1942 on object for static data members.
1944 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1945 Jason Merrill <jason@redhat.com>
1948 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1949 with the same type, call mark_lvalue_use on both.
1951 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1953 * class.c (struct vtbl_init_data_s): Remove last_init field.
1954 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1956 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1958 (build_vtt): Likewise.
1959 (initialize_vtable): Take a VEC instead of a tree.
1960 (build_vtt_inits): Change return type to void. Take a VEC **
1961 instead of a tree *; accumulate results into said VEC.
1962 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1963 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1964 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1966 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1967 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1969 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1970 rather than tree_cons.
1971 (build_vbase_offset_vtbl_entries): Likewise.
1972 (add_vcall_offset): Likewise.
1973 (build_rtti_vtbl_entries): Likewise.
1974 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1975 * decl.c (initialize_artificial_var): Use build_constructor instead
1976 of build_constructor_from_list.
1978 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1981 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1984 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1986 * parser.c (cp_parser_mem_initializer_list): Change error text.
1988 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1990 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1991 tree_decl_map hashtab from tree_map.
1992 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1993 (init_shadowed_var_for_decl): Adjust initialization.
1996 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1997 instead of calling mark_exp_read only when not an assignment.
2000 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
2001 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
2002 Set DECL_VALUE_EXPR on var.
2004 2010-06-02 Jason Merrill <jason@redhat.com>
2006 * error.c (dump_type): Improve typedef handling.
2011 * name-lookup.c (same_entity_p): New.
2012 (ambiguous_decl): Multiple declarations of the same entity
2015 2010-06-01 Jason Merrill <jason@redhat.com>
2018 * call.c (add_list_candidates): Prefer the default constructor.
2019 (build_aggr_conv): Treat missing initializers like { }.
2020 * typeck2.c (process_init_constructor_record): Likewise.
2021 * init.c (expand_default_init): Use digest_init for
2022 direct aggregate initialization, too.
2024 * call.c (add_list_candidates): Split out...
2025 (build_user_type_conversion_1): ...from here.
2026 (build_new_method_call): And here.
2027 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
2030 * call.c (build_list_conv): Set list-initialization flags properly.
2032 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
2034 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
2036 2010-06-01 Arnaud Charlet <charlet@adacore.com>
2037 Matthew Gingell <gingell@adacore.com>
2039 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
2040 * decl2.c: Include langhooks.h and c-ada-spec.h.
2041 (cpp_check, collect_source_refs, collect_ada_namespace,
2042 collect_all_refs): New functions.
2043 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
2044 * lang-specs.h: Ditto.
2046 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2048 * cp-tree.h (cp_build_function_call_nary): Declare.
2049 * typeck.c (cp_build_function_call_nary): Define.
2050 * decl.c (register_dtor_fn): Use it instead of
2051 cp_build_function_call.
2052 (cxx_maybe_build_cleanup): Likewise.
2053 * decl2.c (generate_ctor_or_dtor_function): Likewise.
2054 * except.c (do_get_exception_ptr): Likewise.
2055 (do_begin_catch): Likewise.
2056 (do_allocate_exception): Likewise.
2057 (do_free_exception): Likewise.
2058 (build_throw): Likewise. Use cp_build_function_call_vec instead
2059 of cp_build_function_call.
2060 (do_end_catch): Likewise.
2062 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2064 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2065 (struct cp_declarator): Move id_loc field up.
2067 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2069 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2070 this file is included before c-common.h. Define GCC_DIAG_STYLE
2071 before including diagnostic-core.h and toplev.h.
2072 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2073 * pt.c: Include cp-tree.h before c-common.h.
2075 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2077 * tree.c (c_register_addr_space): Add stub.
2079 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2081 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2084 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2086 Revert fix of PR c++/44188
2087 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2089 * tree.c (typedef_variant_p): Revert moving this definition to
2091 * decl.c (grokdeclarator): Revert naming typedef handling.
2093 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2095 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2096 * cp-lang.c: Don't include diagnostic.h
2097 * name-lookup.c: Include diagnostic-core.h instead of
2099 (cp_emit_debug_info_for_using): Use seen_error.
2100 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2101 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2102 * pt.c (iterative_hash_template_arg): Use seen_error.
2103 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2104 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2105 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2106 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2109 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2112 * cp-tree.h (typedef_variant_p): Move this declaration to
2114 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2115 * decl.c (grokdeclarator): Do not rename debug info of an
2116 anonymous tagged type named by a typedef.
2118 2010-05-27 Jason Merrill <jason@redhat.com>
2121 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2124 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2127 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2128 * class.c (layout_class_type): Likewise.
2129 * decl.c (finish_enum): Likewise.
2130 * mangle.c (write_builitin_type): Likewise.
2132 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2134 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2136 * decl.c (grokdeclarator): Handle __int128.
2137 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2138 (cp_parser_simple_type_specifier): Likewise.
2139 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2140 * typeck.c (cp_common_type): Handle __int128.
2141 * mangle.c (integer_type_codes): Add itk_int128 and
2142 itk_unsigned_int128.
2144 2010-05-26 Jason Merrill <jason@redhat.com>
2147 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2150 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2152 * cp-lang.c: Do not include expr.h.
2154 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2156 * decl.c: Do not include rtl.h
2157 * semantics.c: Likewise.
2159 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2161 * cp-tree.h: Do not include splay-tree.h.
2162 (struct prtmem_cst): Remove unused field and false comment.
2163 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2164 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2165 * init.c: Do not include rtl.h and expr.h.
2166 * class.c: Do not include rtl.h. Include splay-tree.h.
2167 (build_clone): Use plain NULL instead of NULL_RTX.
2168 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2169 included. Include splay-tree.h.
2170 * method.c: Do not include rtl.h and expr.h.
2171 (use_thunk): Use plain NULL instead of NULL_RTX.
2172 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2173 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2174 and target.h. Include splay-tree.h.
2175 * expr.c: Do not include rtl.h and expr.h.
2176 * pt.c: Do not include obstack.h and rtl.h.
2177 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2178 (tsubst_decl): Likewise.
2179 (instantiate_decl): Likewise.
2180 * semantics.c: Do not include exprt.h and debug.h. Explain why
2181 rtl.h has to be included.
2182 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2183 * call.c: Do not include rtl.h and expr.h.
2184 * search.c: Do not include obstack.h and rtl.h.
2185 * friend.c: Do not include rtl.h and expr.h.
2186 * Make-lang.in: Update dependencies.
2188 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2191 * parser.c (non_integral_constant): Add NIC_NONE.
2192 (required_token): Add RT_NONE.
2193 (cp_parser_unary_expression): Initialize non_constant_p
2195 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2196 (cp_parser_primary_expression, cp_parser_postfix_expression,
2197 cp_parser_cast_expression, cp_parser_binary_expression,
2198 cp_parser_functional_cast): Fix formatting.
2200 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2203 * parser.c: Remove inclusion of dyn-string.h.
2204 (non_integral_constant): New enum.
2205 (name_lookup_error): New enum.
2206 (required_token): New enum.
2207 (cp_parser_required_error): New function.
2208 (cp_parser_require): Change the type of variable token_desc to
2209 required_token and use cp_parser_required_error.
2210 (cp_parser_require_keyword): Likewise.
2211 (cp_parser_error): Use gmsgid as parameter.
2212 (cp_parser_name_lookup_error): Change the type of variable desired to
2213 name_lookup_error and put the diagnostic in the full sentences. Change
2215 (cp_parser_non_integral_constant_expression): Change the type of the
2216 variable thing to non_integral_constant and put the diagnostics in
2217 full sentences. Change caller.
2219 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2222 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2224 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2226 * error.c (cp_diagnostic_starter): Update call to
2227 diagnostic_build_prefix.
2228 (cp_print_error_function,
2229 print_instantiation_partial_context_line): Check show_column flag
2232 2010-05-24 Jason Merrill <jason@redhat.com>
2235 * decl.c (check_initializer): Don't wrap an init-list in a
2237 * init.c (build_aggr_init): Don't assume copy-initialization if
2238 init has CONSTRUCTOR_IS_DIRECT_INIT.
2239 * call.c (build_new_method_call): Sanity check.
2241 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2243 * rtti.c (tinfo_base_init): Use build_constructor instead of
2244 build_constructor_from_list. Don't cons a tree node for
2246 (generic_initializer): Use build_constructor_single instead of
2247 build_constructor_from_list.
2248 (ptr_initializer): Use build_constructor instead of
2249 build_constructor_from_list
2250 (ptm_initializer): Likewise.
2251 (class_initializer): Likewise. Take varargs instead of TRAIL.
2252 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2253 build_constructor instead of build_constructor_from_list.
2255 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2257 * semantics.c: Include bitmap.h.
2258 * Make-lang.in: Update dependencies.
2260 2010-05-22 Jan Hubicka <jh@suse.cz>
2262 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2264 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2266 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2268 * cxx-pretty-print.c: Correct merge error.
2270 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2272 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2273 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2274 (cp_printer): Handle %K here using percent_K_format.
2275 * cxx-pretty-print.c: Include tree-pretty-print.h.
2276 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2279 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2281 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2282 Clean up redundant includes.
2284 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2287 * decl.c (xref_basetypes): Return false in case of ill-formed
2290 2010-05-19 Jason Merrill <jason@redhat.com>
2292 * call.c (reference_binding): Use cp_build_qualified_type_real
2293 and cp_type_quals consistently.
2294 (add_function_candidate): Likewise.
2295 (build_conditional_expr): Likewise.
2296 (convert_like_real): Likewise.
2297 (type_passed_as): Likewise.
2298 * class.c (add_method): Likewise.
2299 (same_signature_p): Likewise.
2300 (layout_class_type): Likewise.
2301 * decl.c (cxx_init_decl_processing): Likewise.
2302 (cp_fname_init): Likewise.
2303 (grokdeclarator): Likewise.
2304 * decl2.c (cp_reconstruct_complex_type): Likewise.
2305 * init.c (build_new_1): Likewise.
2306 * method.c (do_build_copy_constructor): Likewise.
2307 (implicitly_declare_fn): Likewise.
2308 * pt.c (tsubst_aggr_type): Likewise.
2310 * rtti.c (init_rtti_processing): Likewise.
2311 (build_headof): Likewise.
2312 (build_dynamic_cast_1): Likewise.
2313 (tinfo_base_init): Likewise.
2314 (emit_support_tinfos): Likewise.
2315 * semantics.c (capture_decltype): Likewise.
2316 * tree.c (cv_unqualified): Likewise.
2317 * typeck.c (composite_pointer_type): Likewise.
2318 (string_conv_p): Likewise.
2320 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2322 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2323 * decl.c (start_decl): Likewise.
2324 * semantics.c (finish_compound_literal): Likewise.
2325 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2326 (cp_type_readonly): Remove.
2327 * cp-tree.h: Remove declaration.
2329 * typeck.c (merge_types): Preserve memfn quals.
2331 * decl.c (grokdeclarator): Don't check quals on fn type.
2332 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2333 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2336 * typeck.c (type_memfn_quals): New fn.
2337 (apply_memfn_quals): New fn.
2338 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2339 (cp_type_readonly): Use cp_type_quals.
2340 * cp-tree.h: Add declarations.
2341 * tree.c (cp_build_qualified_type_real): Don't set, but do
2342 preserve, quals on FUNCTION_TYPE.
2343 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2344 * decl.c (build_ptrmem_type): Likewise.
2345 (grokdeclarator): Likewise.
2346 (static_fn_type): Likewise.
2347 * decl2.c (change_return_type): Likewise.
2348 (cp_reconstruct_complex_type): Likewise.
2349 * pt.c (tsubst_function_type): Likewise.
2351 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2353 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2355 * tree.c (build_min_non_dep_call_vec): Update comment.
2357 2010-05-17 Jason Merrill <jason@redhat.com>
2359 * call.c (struct z_candidate): Add explicit_targs field.
2360 (add_template_candidate_real): Set it.
2361 (build_over_call): Use it to control init-list warning.
2364 * call.c (build_over_call): Limit init-list deduction warning to
2365 cases where the argument is actually an init-list.
2368 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2370 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2371 Jason Merrill <jason@redhat.com>
2374 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2376 2010-05-15 Jason Merrill <jason@redhat.com>
2378 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2379 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2381 (finish_eh_spec_block): Adjust.
2383 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2386 * pt.c (tsubst): Unshare template argument.
2388 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2390 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2391 * Make-lang.in: Fix dependencies accordingly.
2393 2010-05-14 Jason Merrill <jason@redhat.com>
2396 * except.c (build_throw): Simplify, adjust for DR 475.
2399 * except.c (dtor_nothrow): Return nonzero for type with
2403 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2404 gimple_build_eh_must_not_throw.
2406 2010-05-14 Martin Jambor <mjambor@suse.cz>
2408 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2411 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2413 * call.c (build_new_method_call): Change warning text.
2414 * typeck2.c (build_functional_cast): Change error text.
2416 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2419 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2420 shadowing the outer parameter or variables by the declaration of
2421 nested function in nested structure or class. Warn the shadowing by
2422 the declaration of nested lambda expression.
2424 2010-05-13 Jason Merrill <jason@redhat.com>
2426 * typeck.c (cp_build_array_ref): Factor out from...
2427 (build_array_ref): ...here. Drop complain parm.
2428 (build_new_op): Adjust.
2429 * class.c (build_vtbl_ref_1): Adjust.
2430 * decl2.c (grok_array_decl): Adjust.
2431 * cp-tree.h: Adjust prototypes.
2433 2010-05-13 Jan Hubicka <jh@suse.cz>
2435 * decl.c (cp_finish_decl): Do not worry about used attribute.
2437 2010-05-12 Jason Merrill <jason@redhat.com>
2439 * typeck.c (build_array_ref): Take complain parm.
2440 * cp-tree.h: Add it to prototype.
2441 * call.c (build_new_op): Pass it.
2442 * class.c (build_vtbl_ref): Pass it.
2443 * decl2.c (grok_array_decl): Pass it.
2447 * cp-tree.def (NULLPTR_TYPE): Remove.
2448 * cp-tree.h (NULLPTR_TYPE_P): New.
2449 (SCALAR_TYPE_P): Use it.
2450 (nullptr_type_node): New.
2451 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2452 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2454 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2455 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2456 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2457 * mangle.c (write_type): Likewise.
2458 * name-lookup.c (arg_assoc_type): Likewise.
2459 * typeck.c (build_reinterpret_cast_1): Likewise.
2460 * rtti.c (typeinfo_in_lib_p): Likewise.
2461 (emit_support_tinfos): Remove local nullptr_type_node.
2463 * cp-tree.h (UNKNOWN_TYPE): Remove.
2464 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2465 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2466 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2467 * class.c (instantiate_type): Check unknown_type_node rather than
2469 * name-lookup.c (maybe_push_decl): Likewise.
2470 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2471 (get_typeid): Likewise.
2472 * semantics.c (finish_offsetof): Likewise.
2475 * call.c (add_template_candidate_real): If deduction fails, still
2476 add the template as a non-viable candidate.
2477 (equal_functions): Handle template candidates.
2478 (print_z_candidate): Likewise.
2479 (print_z_candidates): Likewise.
2480 (build_new_function_call): Likewise.
2482 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2483 * call.c (add_candidates): Enforce it.
2484 (build_new_method_call): Try non-list ctor if no viable list ctor.
2485 (build_user_type_conversion_1): Likewise.
2487 * call.c (add_candidates): Distinguish between type(x) and
2489 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2490 (build_new_method_call): Give better error for conversion op.
2492 * call.c (add_candidates): Add first_arg and return_type parms.
2493 Add special constructor/conversion op handling.
2494 (convert_class_to_reference): Use it.
2495 (build_user_type_conversion_1): Likewise.
2496 (build_op_call): Likewise.
2497 (build_new_method_call): Likewise.
2498 (build_new_op): Adjust.
2499 (perform_overload_resolution): Adjust.
2501 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2506 * pt.c (process_partial_specialization): Return error_mark_node
2507 in case of unused template parameters in partial specialization.
2509 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2512 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2513 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2514 look at its second operand.
2516 2010-05-10 Jason Merrill <jason@redhat.com>
2519 * semantics.c (baselink_for_fns): Revert earlier change.
2522 * typeck.c (cp_build_modify_expr): Complain about assignment to
2523 array from init list.
2525 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2528 * decl.c (check_initializer): strip array type before checking for
2529 uninitialized const or ref members.
2531 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2534 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2535 error count. Emit errors only if compain is true.
2536 (build_new_1): Do not return error_mark_node if
2537 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2538 errors. Delay the check for user-provided constructor.
2539 (perform_member_init): Adjust.
2540 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2543 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2544 Jason Merrill <jason@redhat.com>
2546 Add support for C++0x nullptr.
2547 * cp-tree.def: Add NULLPTR_TYPE.
2548 * cp-tree.h: Add nullptr_node.
2549 (cp_tree_index): Add CPTI_NULLPTR.
2550 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2551 * call.c (null_ptr_cst_p): Handle nullptr.
2552 (standard_conversion): Likewise.
2553 (convert_arg_to_ellipsis): Likewise.
2554 * mangle.c (write_type): Likewise.
2555 * name-lookup.c (arg_assoc_type): Likewise.
2556 * parser.c (cp_parser_primary_expression): Likewise.
2557 * typeck.c (cp_build_binary_op): Likewise.
2558 (build_reinterpret_cast_1): Likewise.
2559 * error.c (dump_type): Likewise.
2560 (dump_type_prefix, dump_type_suffix): Likewise.
2561 * decl.c (cxx_init_decl_processing): Likewise.
2562 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2563 * cvt.c (ocp_convert): Likewise.
2564 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2565 nullptr_t tinfo in libsupc++.
2567 2010-05-06 Jason Merrill <jason@redhat.com>
2569 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2571 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2572 Dodji Seketeli <dodji@redhat.com>
2575 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2577 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2578 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2579 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2580 (cp_build_unary_op): Call lvalue_use.
2581 * decl.c (unused_but_set_errorcount): New variable.
2582 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2583 (duplicate_decls): Merge DECL_READ_P flags.
2584 (start_cleanup_fn): Set DECL_READ_P flag.
2585 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2586 * tree.c (rvalue): Call rvalue_use.
2587 * pt.c (convert_nontype_argument): Likewise.
2588 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2589 finish_decltype_type): Likewise.
2590 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2591 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2592 or rvalue_use depending on the expr.
2593 * init.c (build_new, build_delete): Likewise.
2594 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2596 2010-05-05 Jason Merrill <jason@redhat.com>
2599 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2600 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2602 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2605 * pt.c (unify): Check each elt for error_mark_node.
2607 2010-05-04 Jason Merrill <jason@redhat.com>
2610 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2612 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2615 * call.c (build_new_method_call): Return error_mark_node if fns is
2618 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2621 * pt.c (most_specialized_class): Pretend we are processing
2622 a template decl during the call to coerce_template_parms.
2624 2010-05-03 Jason Merrill <jason@redhat.com>
2628 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2629 from the selected underlying type unless -fstrict-enums. Set
2630 ENUM_UNDERLYING_TYPE to have the restricted range.
2631 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2632 * class.c (check_bitfield_decl): Likewise.
2634 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2637 * init.c (build_new_1): Revert the accidental checkin in
2640 2010-04-30 Jason Merrill <jason@redhat.com>
2643 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2644 (pp_cxx_type_specifier_seq): ...here.
2646 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2648 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2649 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2651 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2654 * typeck.c (warn_args_num): New function.
2655 (convert_arguments): Use warn_args_num to print the diagnostic
2658 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2661 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2662 user-provided constructor while recursing.
2664 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2667 * error.c (print_instantiation_partial_context_line): Handle
2668 recursive instantiation.
2669 (print_instantiation_partial_context): Likewise.
2671 2010-04-27 Jason Merrill <jason@redhat.com>
2673 * init.c (perform_member_init): Check CLASS_TYPE_P.
2675 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2678 * init.c (perform_member_init): check for uninitialized const or
2679 reference members, including array types.
2681 2010-04-24 Jason Merrill <jason@redhat.com>
2683 * tree.c (get_fns): Split out from get_first_fn.
2684 * cp-tree.h: Declare it.
2685 * search.c (shared_member_p): Use it.
2686 * semantics.c (finish_qualified_id_expr): Simplify.
2687 (finish_id_expression): Simplify.
2689 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2690 whenever object is NULL_TREE. Don't do 'this' capture here.
2691 (finish_qualified_id_expr): Pass NULL_TREE.
2692 (finish_id_expression): Likewise.
2693 (lambda_expr_this_capture): Likewise.
2695 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2696 rather than checking current_class_ref directly.
2697 (finish_call_expr): Likewise.
2700 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2701 * class.c (current_nonlambda_class_type): New fn.
2702 * semantics.c (nonlambda_method_basetype): New.
2703 * cp-tree.h: Declare them.
2704 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2706 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2709 * semantics.c (lambda_return_type): Complain about
2713 * tree.c (cv_unqualified): Handle error_mark_node.
2716 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2717 if we don't want errors.
2720 * class.c (convert_to_base): Add complain parameter. Pass
2721 ba_quiet to lookup_base if we don't want errors.
2722 (build_vfield_ref): Pass complain to convert_to_base.
2723 * call.c (convert_like_real): Likewise.
2724 (initialize_reference): Likewise.
2725 (perform_direct_initialization_if_possible): Pass complain to
2727 * cp-tree.h: Adjust.
2729 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2730 Jason Merrill <jason@redhat.com>
2733 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2735 (check_initializer): Call it for classes that need constructing, too.
2736 * class.c (in_class_defaulted_default_constructor): New.
2737 * cp-tree.h: Declare it.
2739 2010-04-20 Jason Merrill <jason@redhat.com>
2742 * init.c (constant_value_1): Treat error_mark_node as a constant
2743 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2744 * cvt.c (ocp_convert): Handle getting error_mark_node from
2745 integral_constant_value.
2746 * decl.c (compute_array_index_type): Likewise.
2748 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2752 * typeck.c (incompatible_dependent_types_p): If one of the
2753 compared types if not a typedef then honour their main variant
2756 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2758 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2760 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2763 * typeck.c (structural_comptypes): Test dependent typedefs
2764 incompatibility before testing for their main variant based
2767 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2769 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2770 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2772 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2774 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2775 build_common_tree_nodes.
2777 2010-04-14 Jason Merrill <jason@redhat.com>
2780 * parser.c (cp_parser_parenthesized_expression_list): Change
2781 is_attribute_list parm to int to indicate whether or not to
2782 handle initial identifier specially.
2783 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2785 2010-04-13 Jason Merrill <jason@redhat.com>
2787 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2789 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2790 unevaluated context.
2791 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2793 2010-04-12 Jason Merrill <jason@redhat.com>
2796 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2797 return value directly.
2799 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2801 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2804 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2805 * init.c (build_new_1): Check for uninitialized const members and
2806 uninitialized reference members, when using new without
2807 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2808 (diagnose_uninitialized_cst_or_ref_member): Define, call
2809 diagnose_uninitialized_cst_or_ref_member_1.
2810 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2812 2010-04-12 Richard Guenther <rguenther@suse.de>
2815 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2816 template inline functions.
2818 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2821 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2824 2010-04-07 Jason Merrill <jason@redhat.com>
2827 * decl.c (start_preparsed_function): Do defer nested functions.
2829 PR c++/11094, DR 408
2830 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2831 * decl2.c (finish_static_data_member_decl): Set it.
2832 * decl.c (duplicate_decls): Propagate it.
2833 * pt.c (tsubst_decl): Don't substitute the domain of an array
2834 VAR_DECL if it's set.
2835 (regenerate_decl_from_template): Substitute it here.
2836 (type_dependent_expression_p): Return true if it's set.
2837 * semantics.c (finish_decltype_type): Instantiate such a variable.
2838 * typeck.c (cxx_sizeof_expr): Likewise.
2839 (strip_array_domain): New.
2842 * name-lookup.c (current_decl_namespace): Non-static.
2843 (pop_nested_namespace): Sanity check.
2844 * cp-tree.h: Declare current_decl_namespace.
2845 * decl.c (grokvardecl): Use it instead of current_namespace.
2846 (grokfndecl): Likewise.
2849 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2852 * pt.c (print_template_statistics): New.
2853 * cp-tree.h: Declare it.
2854 * tree.c (cxx_print_statistics): Call it.
2857 * decl.c (grokvardecl): Tweak warning message.
2858 (grokfndecl): Likewise.
2860 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2863 *pt.c (tsubst_decl): Get the arguments of a specialization from
2864 the specialization template, not from the most general template.
2866 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2869 * typeck2.c (process_init_constructor_record):
2870 value-initialize members that are are not explicitely
2873 2010-04-07 Jie Zhang <jie@codesourcery.com>
2876 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2877 when all of its elements are non-constant and have been split out.
2879 2010-04-06 Taras Glek <taras@mozilla.com>
2880 Jason Merrill <jason@redhat.com>
2882 * parser.c (cp_parser_class_specifier): Set class location to that
2883 of IDENTIFIER_NODE instead of '{' when possible.
2884 * semantics.c (begin_class_definition): Do not overide locations
2885 with less precise ones.
2887 2010-04-06 Jason Merrill <jason@redhat.com>
2890 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2893 * pt.c (maybe_update_decl_type): Check the return value from
2896 2010-04-01 Jason Merrill <jason@redhat.com>
2898 * decl.c (next_initializable_field): No longer static.
2899 * cp-tree.h: Declare it.
2900 * call.c (build_aggr_conv): Fail if there are more initializers
2901 than initializable fields.
2903 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2904 instead of void_zero_node.
2906 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2909 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2910 * pt.c (end_template_parm_list): Store sibling template parms of
2911 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2912 (push_template_decl_real): Don't store the containing template decl
2913 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2914 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2915 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2918 2010-03-30 Jason Merrill <jason@redhat.com>
2921 * pt.c (push_template_decl_real): Deal better with running out of
2922 scopes before running out of template parms.
2926 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2927 function parameter context. Don't print an error if parsing
2931 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2934 2010-03-26 Jason Merrill <jason@redhat.com>
2937 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2938 c++0x mode, but not other type-names.
2940 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2943 * pt.c (add_to_template_args): Support NULL ARGS;
2944 (most_specialized_class): call coerce_template_parms on
2945 template arguments passed to get_class_bindings. Use
2946 add_to_template_args.
2947 (unify): Handle VAR_DECLs.
2949 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2951 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2953 * pt.c (get_template_parms_at_level): Adjust.
2955 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2958 * cp-tree.h (get_template_parms_at_level): Declare ...
2959 * pt.c (get_template_parms_at_level): ... new function.
2960 * typeck.c (get_template_parms_of_dependent_type): If a template
2961 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2962 current_template_parms. Use get_template_parms_at_level. Remove
2964 (incompatible_dependent_types_p): If we get empty parms from just one
2965 of the template type parms we are comparing then the template parms are
2968 2010-03-24 Jason Merrill <jason@redhat.com>
2971 * parser.c (make_declarator): Initialize id_loc.
2972 (cp_parser_lambda_declarator_opt): And set it.
2974 2010-03-23 Jason Merrill <jason@redhat.com>
2976 Make lambda conversion op and op() non-static.
2977 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2978 Also add the thunk function returned by the conversion op.
2979 Mark the conversion deleted if the op() is variadic.
2980 * decl2.c (mark_used): Give helpful message about deleted conversion.
2981 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2982 * semantics.c (finish_this_expr): Adjust.
2983 * mangle.c (write_closure_type_name): Adjust.
2984 * decl.c (grok_op_properties): Don't allow it.
2985 * call.c (build_user_type_conversion_1): No static conversion ops.
2986 (build_op_call): Or op().
2988 * decl2.c (change_return_type): Fix 'this' quals.
2990 2010-03-22 Jason Merrill <jason@redhat.com>
2993 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2996 * pt.c (contains_auto_r): New fn.
2997 (do_auto_deduction): Use it.
2998 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
3000 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
3003 * decl2.c (grokfield): Handle invalid initializers for member
3006 2010-03-20 Dodji Seketeli <dodji@redhat.com>
3009 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
3011 * decl2.c (vague_linkage_p): Likewise.
3013 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
3016 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
3017 false, in the cp_parser_expression_statement call.
3019 2010-03-05 Jason Merrill <jason@redhat.com>
3021 * mangle.c (mangle_decl): Give name collision error even without
3024 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
3026 * pt.c (process_partial_specialization): Use error_n instead of
3029 2010-03-03 Jason Merrill <jason@redhat.com>
3032 * mangle.c (mangle_decl): Handle VAR_DECL, too.
3034 2010-03-03 Jason Merrill <jason@redhat.com>
3037 * mangle.c: Include cgraph.h.
3038 (mangle_decl): If the mangled name will change in a later
3039 ABI version, make the later mangled name an alias.
3040 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
3041 * Make-lang.in (mangle.o): Depend on cgraph.h.
3042 * method.c (make_alias_for): Handle VAR_DECL, too.
3043 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
3044 * tree.c (no_linkage_check): Adjust.
3045 * decl.c (maybe_commonize_var): Adjust.
3046 * cp-tree.h: Adjust.
3048 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
3050 * pt.c (redeclare_class_template): Use error_n and inform_n.
3052 2010-02-27 Mark Mitchell <mark@codesourcery.com>
3055 * cp-tree.h (push_tinst_level): Declare.
3056 (pop_tinst_level): Likewise.
3057 * pt.c (push_tinst_level): Give it external linkage.
3058 (pop_tinst_level): Likewise.
3059 * mangle.c (mangle_decl_string): Set the source location to that
3060 of the decl while mangling.
3062 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
3065 * pt.c (redeclare_class_template): Return false if there are erroneous
3066 template parameters.
3068 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
3070 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
3073 2010-02-24 Jason Merrill <jason@redhat.com>
3076 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3078 * class.c (layout_class_type): Don't give -Wabi warning for a bug
3079 in a previous ABI version.
3081 2010-02-23 Jason Merrill <jason@redhat.com>
3084 * typeck2.c (digest_init_r): Accept value init of array.
3086 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
3089 * typeck.c (convert_arguments): Update error message.
3091 2010-02-22 Mike Stump <mikestump@comcast.net>
3094 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3096 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3099 * error.c (print_instantiation_partial_context_line): New.
3100 (print_instantiation_partial_context): Print at most 12 contexts,
3101 skip the rest with a message.
3103 2010-02-21 Dodji Seketeli <dodji@redhat.com>
3106 * pt.c (lookup_template_class): Better support of specialization
3107 of member of class template implicit instantiation.
3109 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
3112 * call.c (conversion_null_warnings): Replace -Wconversion with
3114 * cvt.c (build_expr_type_conversion): Likewise.
3116 2010-02-18 Jason Merrill <jason@redhat.com>
3119 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3122 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3124 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3125 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3128 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3132 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3133 (maybe_update_decl_type): New fn.
3134 * parser.c (cp_parser_init_declarator): Use it.
3137 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3139 2010-02-17 Jason Merrill <jason@redhat.com>
3142 * call.c (build_over_call): Don't create zero-sized assignments.
3143 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3144 * cp-objcp-common.c (cp_expr_size): Remove.
3145 * cp-tree.h: Remove prototype.
3148 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3149 decl we looked up doesn't match.
3152 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3153 have an INIT_EXPR anymore.
3156 * pt.c (convert_nontype_argument): Change assert to test.
3158 2010-02-16 Jason Merrill <jason@redhat.com>
3160 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3163 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3164 VIEW_CONVERT_EXPR for conversions between structural equality types
3165 that the back end can't tell are the same.
3168 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3169 cv-quals from element here.
3170 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3172 2010-02-14 Jason Merrill <jason@redhat.com>
3175 * semantics.c (finish_compound_literal): Use
3176 cp_apply_type_quals_to_decl when creating a static variable.
3178 2010-02-12 Jason Merrill <jason@redhat.com>
3181 * name-lookup.h (current_binding_level): Check for null
3184 2010-02-12 Jason Merrill <jason@redhat.com>
3187 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3189 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3192 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3195 2010-02-10 Jason Merrill <jason@redhat.com>
3198 * semantics.c (outer_lambda_capture_p): Revert.
3199 (add_capture): Only finish_member_declaration if
3200 we're in the lambda class.
3201 (register_capture_members): New.
3202 * cp-tree.h: Declare it.
3203 * parser.c (cp_parser_lambda_expression): Call it.
3205 2010-02-10 Jason Merrill <jason@redhat.com>
3208 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3209 instead of current_class_type.
3211 2010-02-10 Jason Merrill <jason@redhat.com>
3213 PR c++/42983, core issue 906
3214 * method.c (defaultable_fn_check): Check virtualness.
3216 2010-02-10 Jason Merrill <jason@redhat.com>
3219 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3221 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3223 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3224 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3226 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3227 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3228 (cp_parser_parameter_declaration)
3229 (cp_parser_exception_specification_opt)
3230 (cp_parser_exception_declaration): Likewise.
3231 * pt.c (check_default_tmpl_args): Likewise.
3232 * search.c (lookup_field_r): Likewise.
3234 2010-02-09 Jason Merrill <jason@redhat.com>
3237 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3239 2010-02-09 Jason Merrill <jason@redhat.com>
3242 * decl2.c (change_return_type): New fn.
3243 * semantics.c (apply_lambda_return_type): Use it.
3244 * cp-tree.h: Declare it.
3246 2010-02-05 Richard Guenther <rguenther@suse.de>
3248 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3249 * cp-lang.c: Include gt-cp-cp-lang.h.
3250 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3252 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3255 * typeck.c (get_template_parms_of_dependent_type): Try getting
3256 the template parameters fromt the type itself first.
3258 2010-02-03 Jason Merrill <jason@redhat.com>
3262 * mangle.c (write_unqualified_id): Split out from write_expression.
3263 (write_unqualified_name): Call it.
3264 (write_member_name): Likewise.
3265 (write_expression): Support TEMPLATE_ID_EXPR.
3266 Disambiguate operator names.
3269 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3272 2010-02-02 Jason Merrill <jason@redhat.com>
3275 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3276 * optimize.c (clone_body): Remap their initializers when making base
3278 (maybe_clone_body): Complain if multiple clones aren't safe.
3280 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3287 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3288 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3289 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3290 * pt.c (coerce_template_parms, type_unification_real,
3291 expand_template_argument_pack, coerce_template_parameter_pack):
3292 Set the non default template args count.
3293 (current_template_args): Always set non defaulted
3294 template args count when compiled with --enable-checking
3295 (tsubst_template_args, type_unification_real): Propagate the non
3296 defaulted template args count.
3297 * error.c (get_non_default_template_args_count): Renamed
3298 count_non_default_template_args into this. Don't calculate the
3299 non default template argument count anymore. Use the new
3300 accessor macros above to get it.
3301 (dump_template_argument_list, dump_type, dump_decl,
3302 dump_template_parms): Adjust.
3303 * parser.c (cp_parser_template_argument_list): Always set defaulted
3304 template args count when compiled with --enable-checking.
3306 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3308 * decl.c (redeclaration_error_message): Wrap the return messages into
3309 G_() for easy translation.
3311 2010-01-28 Jason Merrill <jason@redhat.com>
3314 * semantics.c (begin_class_definition): Don't use type_as_string.
3316 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3320 * typeck.c (get_template_parms_of_dependent_type): Factorized
3321 this out of incompatible_template_type_parms_p
3322 (incompatible_dependent_types_p): Renamed
3323 incompatible_template_type_parms_p into this. Make it detect
3324 two incompatible dependent typedefs too.
3325 (structural_comptypes): Use incompatible_dependent_types_p.
3326 * pt.c (get_template_info):
3327 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3329 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3330 Jason Merrill <jason@redhat.com>
3332 * mangle.c (write_type): Mangle transparent record as member type.
3333 * semantics.c (begin_class_definition): Recognize decimal classes
3334 and set TYPE_TRANSPARENT_AGGR.
3336 2010-01-20 Jason Merrill <jason@redhat.com>
3339 * mangle.c (write_expression): Handle tree codes that have extra
3340 arguments in the middle-end.
3342 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3345 * except.c (expand_start_catch_block): Deal correctly with
3346 do_begin_catch returning error_mark_node.
3348 2010-01-20 Jason Merrill <jason@redhat.com>
3351 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3355 * semantics.c (build_lambda_object): Call mark_used on captured
3359 * decl.c (grokdeclarator): Clear type_quals for a member function
3360 declared using a typedef. Don't complain about adding cv-quals
3361 to a function typedef in C++0x mode.
3363 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3365 * decl.c (create_array_type_for_decl): Remove set but not used
3366 variable error_msg. Remove break stmts after return stmts.
3368 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3370 * error.c (dump_template_parms, count_non_default_template_args):
3371 Revert fix of PR c++/42634.
3373 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3376 * error.c (dump_template_parms): Use innermost template
3377 arguments before calling count_non_default_template_args.
3378 (count_non_default_template_args): We are being called with
3379 template innermost arguments now. There is no need to ensure
3382 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3385 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3387 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3390 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3392 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3395 *pt.c (tsubst_decl): Get the arguments of a specialization from
3396 the specialization template, not from the most general template.
3398 2010-01-16 Jason Merrill <jason@redhat.com>
3401 * semantics.c (finish_decltype_type): Within a template, treat
3402 unresolved CALL_EXPR as dependent.
3404 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3406 * error.c (dump_template_parms,count_non_default_template_args):
3407 Revert changes of PR c++/42634.
3409 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3412 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3413 functions with noreturn attribute.
3415 2010-01-14 Jason Merrill <jason@redhat.com>
3418 * call.c (build_new_method_call): Don't free the vec here.
3421 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3423 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3426 * error.c (dump_template_parms): Use innermost template
3427 arguments before calling count_non_default_template_args.
3428 (count_non_default_template_args): We are being called with
3429 template innermost arguments now. There is no need to ensure
3432 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3435 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3436 arguments that were previously deduced.
3438 2010-01-05 Jason Merrill <jason@redhat.com>
3440 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3441 * call.c (build_over_call): Don't complain about it.
3443 2010-01-04 Jason Merrill <jason@redhat.com>
3446 * pt.c (tsubst_decl): Don't apply type attributes in place.
3449 * semantics.c (describable_type): Remove decltype comment and
3454 Copyright (C) 2010 Free Software Foundation, Inc.
3456 Copying and distribution of this file, with or without modification,
3457 are permitted in any medium without royalty provided the copyright
3458 notice and this notice are preserved.