1 2010-11-01 Jason Merrill <jason@redhat.com>
3 * semantics.c (call_stack, call_stack_tick, cx_error_context): New.
4 (last_cx_error_tick, push_cx_call_context, pop_cx_call_context): New.
5 (cxx_eval_call_expression): Call push/pop_cx_call_context instead
6 of giving follow-on errors.
7 * error.c (maybe_print_constexpr_context): New.
8 (cp_diagnostic_starter): Call it.
9 * cp-tree.h: Declare cx_error_context.
11 * semantics.c (cxx_eval_constant_expression): Explain
12 unacceptable use of variable better.
14 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
15 Jason Merrill <jason@redhat.com>
17 * call.c (null_ptr_cst_p): Use maybe_constant_value.
18 (set_up_extended_ref_temp): Support constant initialization.
19 (initialize_reference): Adjust.
20 * class.c (check_bitfield_decl): Use cxx_constant_value.
21 * cvt.c (ocp_convert): Don't use integral_constant_value when
22 converting to class type.
23 * decl.c (finish_case_label): Use maybe_constant_value.
24 (build_init_list_var_init): Support constant initialization.
25 (check_initializer): Likewise. Reorganize.
26 (cp_finish_decl): Likewise.
27 (expand_static_init): Likewise.
28 (compute_array_index_type): Use maybe_constant_value.
30 (create_array_type_for_decl, grokdeclarator): Pass it.
31 (build_enumerator): Use cxx_constant_value.
32 * decl2.c (grokfield): Use maybe_constant_init.
33 * except.c (check_noexcept_r): Handle constexpr.
34 (build_noexcept_spec): Use maybe_constant_value.
35 * init.c (expand_default_init): Support constant initialization.
36 (build_vec_init): Likewise.
37 (constant_value_1): Adjust.
38 (build_new_1): Adjust.
39 * parser.c (cp_parser_constant_expression): Allow non-integral
41 (cp_parser_direct_declarator): Don't fold yet in C++0x mode.
42 (cp_parser_initializer_clause): Toss folded result if non-constant.
43 * pt.c (fold_decl_constant_value): Remove.
44 (convert_nontype_argument): Use maybe_constant_value. Give clearer
46 (tsubst): Move array bounds handling into compute_array_index_type.
47 (value_dependent_expression_p): Handle constant CALL_EXPR.
48 (tsubst_decl): Don't set
49 DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P yet.
50 (tsubst_expr) [DECL_EXPR]: Pass it into cp_finish_decl.
51 (instantiate_decl): Here too.
52 * semantics.c (finish_static_assert): Use maybe_constant_value.
53 (ensure_literal_type_for_constexpr_object): Make sure type is complete.
54 (potential_constant_expression): Use maybe_constant_value.
55 * tree.c (cast_valid_in_integral_constant_expression_p): Any cast
56 is potentially valid in C++0x.
57 * typeck2.c (store_init_value): Handle constant init.
58 (check_narrowing): Use maybe_constant_value.
59 (build_functional_cast): Set TREE_CONSTANT on literal T().
60 * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): Remove.
61 (LOOKUP_ALREADY_DIGESTED): New.
62 (compute_array_index_type): Adjust prototype.
64 * semantics.c (constexpr_call): New datatype.
65 (constexpr_call_table): New global table.
66 (constexpr_call_hash): New.
67 (constexpr_call_equal): Likewise.
68 (maybe_initialize_constexpr_call_table): Likewise.
69 (lookup_parameter_binding): Likewise.
70 (cxx_eval_builtin_function_call): Likewise.
71 (cxx_bind_parameters_in_call): Likewise.
72 (cxx_eval_call_expression): Likewise.
73 (cxx_eval_unary_expression): Likewise.
74 (cxx_eval_binary_expression): Likewise.
75 (cxx_eval_conditional_expression): Likewise.
76 (cxx_eval_array_reference): Likewise.
77 (cxx_eval_component_reference): Likewise.
78 (cxx_eval_logical_expression): Likewise.
79 (cxx_eval_object_construction): Likewise.
80 (cxx_eval_constant_expression): Likewise.
81 (cxx_eval_indirect_ref): Likewise.
82 (cxx_constant_value): Likewise.
83 (cxx_eval_bare_aggregate): Likewise.
84 (adjust_temp_type): New.
85 (reduced_constant_expression_p): New.
86 (verify_constant): New.
87 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
88 (cxx_eval_outermost_constant_expr): New.
89 (maybe_constant_value, maybe_constant_init): New.
90 (cxx_eval_constant_expression): Use them.
91 * pt.c (iterative_hash_template_arg): No longer static.
92 * cp-tree.h: Declare fns.
94 * cp-tree.h (register_constexpr_fundef): Declare.
95 * decl.c (maybe_save_function_definition): New.
96 (finish_function): Use it.
97 * semantics.c (constexpr_fundef): New datatype.
98 (constexpr_fundef_table): New global table.
99 (constexpr_fundef_equal): New.
100 (constexpr_fundef_hash): Likewise.
101 (retrieve_constexpr_fundef): Likewise.
102 (validate_constexpr_fundecl): Store in the table.
103 (build_data_member_initialization): New fn.
104 (build_constexpr_constructor_member_initializers): New.
105 (register_constexpr_fundef): Define.
106 (is_this_parameter): New.
107 (get_function_named_in_call): Likewise.
108 (get_nth_callarg): Likewise.
109 (check_automatic_or_tls): New.
110 (morally_constexpr_builtin_function_p): New.
111 (potential_constant_expression): New.
113 2010-11-01 Jason Merrill <jason@redhat.com>
115 * decl2.c (decl_constant_var_p): New fn.
116 (decl_maybe_constant_var_p): New fn.
117 (mark_used): Rework instantiation of things needed for constant
119 * cp-tree.h: Declare new fns.
120 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
121 (always_instantiate_p): Use decl_maybe_constant_var_p.
122 (instantiate_decl): Don't defer constexpr functions.
123 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
124 * semantics.c (finish_id_expression): Use decl_constant_var_p.
125 Check for valid name in constant expr after mark_used.
127 2010-10-31 Jason Merrill <jason@redhat.com>
129 * class.c (is_really_empty_class): Work when type is not complete.
130 (synthesized_default_constructor_is_constexpr): New.
131 (add_implicitly_declared_members): Use it.
132 (type_has_constexpr_default_constructor): Likewise.
133 * cp-tree.h: Declare it.
134 * method.c (synthesized_method_walk): Use it.
136 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
137 * typeck.c (convert_for_assignment): Likewise.
139 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
140 message about constexpr without -std=c++0x.
142 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
145 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
147 * class.c (layout_vtable_decl): Call build_array_of_n_type.
148 (build_vtt, build_ctor_vtabl_group): Likewise.
150 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
152 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
153 * parser.c (cp_parser_objc_at_property_declaration): Removed
154 parsing of RID_COPIES and RID_IVAR. Updated call to
155 objc_add_property_declaration.
156 * typecheck.c (finish_class_member_access_expr): Call
157 objc_maybe_build_component_ref instead of objc_build_setter_call.
158 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
159 of objc_build_getter_call.
161 2010-10-27 Jason Merrill <jason@redhat.com>
163 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
164 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
165 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
166 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
167 (cp_parser_trait_expr): Likewise.
169 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
170 Jason Merrill <jason@redhat.com>
172 * decl.c (finish_case_label): Use decl_constant_value.
174 * method.c (synthesized_method_walk): Track constexprness too.
175 (process_subob_fn, walk_field_subobs): Likewise.
176 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
177 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
178 * class.c (add_implicitly_declared_members): Handle
179 constexpr default ctor.
181 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
182 Make sure a constexpr ctor has an empty body.
183 * class.c (type_has_constexpr_default_constructor): New.
184 * cp-tree.h: Declare it.
185 * init.c (perform_member_init): Complain about uninitialized
186 member in constexpr ctor.
187 (emit_mem_initializers): And uninitialized base.
188 * decl.c (check_tag_decl): Fix typo.
190 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
191 (is_valid_constexpr_fn): New fn.
192 (validate_constexpr_fundecl): Use it.
193 * decl.c (validate_constexpr_redeclaration): New.
194 (duplicate_decls): Use it.
195 (cp_finish_decl): Call validate_constexpr_fundecl and
196 ensure_literal_type_for_constexpr_object here.
197 (start_decl): Not here. Don't ICE on constexpr reference.
198 (check_for_uninitialized_const_var): Don't handle constexpr specially.
199 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
200 (check_static_variable_definition): Give friendly message about
202 (grokdeclarator): Complain about typedef and volatile with constexpr.
203 Reorganize. Give sorry about non-static data members in C++0x mode.
204 (start_preparsed_function): Check validate_constexpr_fundecl here.
205 (check_function_type): Not here.
206 * decl2.c (finish_static_data_member_decl): Don't complain about
208 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
209 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
210 (cp_parser_decl_specifier_seq): Handle it.
211 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
213 * class.c (check_bases): Propagate non-literality.
214 (check_field_decls): Likewise.
215 (finalize_literal_type_property): New.
216 (check_bases_and_members): Call it.
217 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
218 (lang_type_class): Add has_constexpr_ctor field.
219 (DECL_DECLARED_CONSTEXPR_P): Strip template.
220 * decl.c (grok_special_member_properties): Set
221 TYPE_HAS_CONSTEXPR_CTOR.
223 2010-10-27 Jason Merrill <jason@redhat.com>
225 * call.c (build_integral_nontype_arg_conv): New.
226 * cp-tree.h: Declare it.
227 * pt.c (convert_nontype_argument): Use it.
229 * error.c (dump_simple_decl): Print constexpr.
231 * cvt.c (build_up_reference): Use target_type for the temporary var.
233 * except.c (build_throw): Set EXPR_LOCATION.
235 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
237 * semantics.c (finish_compound_stmt): Avoid creating an
238 unnecessary BIND_EXPR.
240 * call.c (convert_like_real): Don't check narrowing if the element
241 is also an initializer-list.
243 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
245 * parser.c (cp_parser_objc_at_property_declaration): Recognize
246 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
247 Do not use objc_set_property_attr, but use local variables
248 instead. Detect repeated usage of setter, getter and ivar
249 attributes. Improved error processing when a setter name does not
250 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
251 that the token is a keyword. Updated call to
252 objc_add_property_declaration.
254 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
256 * parser.c (cp_parser_objc_property_decl): Renamed to
257 cp_parser_objc_struct_declaration. Return the parsed trees
258 instead of calling objc_add_property_variable directly. Detect
259 missing or invalid declspecs. Implemented attributes. Do not eat
260 the ';' at the end. Exit loop whenever a non-comma is parsed, not
262 (cp_parser_objc_at_property): Renamed to
263 cp_parser_objc_at_property_declaration. Updated calls to
264 objc_add_property_variable, now objc_add_property_declaration, and
265 to cp_parser_objc_property_decl, now
266 cp_parser_objc_struct_declaration. Rewritten all code to be more
267 robust in dealing with syntax errors, and almost identical to the
268 one in c_parser_objc_at_property_declaration.
269 (cp_parser_objc_property_attrlist): Removed.
270 (cp_parser_objc_method_prototype_list): Updated call to
271 cp_parser_objc_at_property.
272 (cp_parser_objc_method_definition_list): Same change.
273 (cp_parser_objc_class_ivars): Detect a number of invalid
274 declarations of instance variables and produce errors when they
277 2010-10-26 Jason Merrill <jason@redhat.com>
279 * tree.c (build_vec_init_expr): Split out from...
280 (build_array_copy): ...here.
281 * init.c (perform_member_init): Use it.
282 * cp-tree.h: Declare it.
283 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
284 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
285 (cp_gimplify_expr): Handle array default-initialization via
288 * tree.c (stabilize_expr): Handle xvalues properly.
290 * call.c (build_over_call): Use argarray[0] for 'this' argument.
292 * decl.c (finish_function): Don't look at function_depth.
294 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
296 Implement opaque-enum-specifiers for C++0x.
297 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
298 (OPAQUE_ENUM_P): New.
299 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
300 (start_enum): Update prototype.
301 (finish_enum_value_list): New prototype.
302 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
303 "enum class" is used in an elaborated-type-specifier.
304 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
305 * decl.c (copy_type_enum): New.
306 (finish_enum_value_list): New, with code from finish_enum.
307 (finish_enum): A lot of code removed. Added a gcc_assert.
308 (start_enum): Add parameters enumtype and is_new.
309 Rewrite to work with opaque-enum-specifiers.
310 * pt.c (maybe_process_partial_specialization): Allow for template
311 specialization of enumerations, with a pedwarn.
312 (lookup_template_class): Update call to start_enum. Call to
314 (tsubst_enum): Call to begin_scope, finish_scope and
315 finish_enum_value_list.
317 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
319 Removed Objective-C++ specific replacement of cxx_printable_name.
320 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
321 to cxx_printable_name for both C++ and Objective-C++.
322 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
324 * error.c (dump_decl): For Objective-C++, call
325 objc_maybe_printable_name here ...
326 * tree.c (cxx_printable_name_internal): ... instead of here.
328 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
330 * tree.c (cxx_printable_name_internal): In Objective-C++, call
331 objc_maybe_printable_name.
333 2010-10-22 Jason Merrill <jason@redhat.com>
336 * pt.c (instantiate_class_template): Don't instantiate default
340 * init.c (build_vec_init): Handle memberwise move.
342 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
345 * call.c (add_function_candidate): Don't use TREE_VALUE on null
348 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
350 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
351 bool instead of calling objc_set_method_type.
352 (cp_parser_objc_method_signature): Updated calls to
353 cp_parser_objc_method_type and to objc_build_method_signature.
354 (cp_parser_objc_method_prototype_list): Updated calls to
355 objc_add_method_declaration. Use token->type to determine if it
356 is a class method or not.
357 (cp_parser_objc_method_definition_list): Same change.
359 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
362 * parser.c (cp_convert_range_for): Call cp_finish_decl
363 instead of finish_expr_stmt.
365 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
367 * cp-lang.c (finish_file): Removed.
368 * decl2.c (cp_write_global_declarations): Call
369 objc_write_global_declarations when compiling Objective-C++.
371 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
374 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
375 (coerce_template_parms): Likewise for args.
377 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
379 Implemented parsing @synthesize and @dynamic for Objective-C++.
380 * parser.c (cp_parser_objc_method_definition_list): Recognize
381 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
382 (cp_parser_objc_at_dynamic_declaration): New.
383 (cp_parser_objc_at_synthesize_declaration): New.
385 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
387 * parser.c (cp_parser_objc_identifier_list): Check the return
388 value of cp_parser_identifier and react if it is error_mark_node.
390 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
392 Merge from apple/trunk branch on FSF servers.
394 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
397 * call.c (standard_conversion, implicit_conversion): Ignore
398 'volatile' attribute of artificially volatized type in objc when
399 evaluating various conversion weights.
401 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
404 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
405 artiificially 'volatized' type before doing pointer comparison.
407 2010-10-18 Jakub Jelinek <jakub@redhat.com>
410 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
413 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
415 Merge from apple/trunk branch on FSF servers.
417 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
420 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
421 objc object types if type is scope qualified.
423 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
425 Merge from apple/trunk branch on FSF servers.
427 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
430 * lex.c (unqualified_name_lookup_error): Issue diagnostic
431 for private 'ivar' access.
433 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
435 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
436 enum, and handle @package.
438 2010-10-15 Jason Merrill <jason@redhat.com>
441 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
442 with a different typedef variant of the element type.
444 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
446 merge from FSF apple 'trunk' branch.
447 2006 Fariborz Jahanian <fjahanian@apple.com>
449 Radars 4436866, 4505126, 4506903, 4517826
450 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
452 (cp_build_modify_expr): Likewise.
453 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
454 (cp_parser_objc_method_definition_list): Likewise.
455 (cp_parser_objc_property_decl): New.
456 (cp_parser_objc_property_attrlist): New.
457 (cp_parser_objc_at_property): New.
459 2010-10-14 Richard Guenther <rguenther@suse.de>
462 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
463 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
465 * error.c (dump_type): Handle NULLPTR_TYPE.
466 (dump_type_prefix): Likewise.
467 (dump_type_suffix): Likewise.
468 * mangle.c (write_type): Likewise.
469 * name-lookup.c (arg_assoc_type): Likewise.
470 * rtti.c (typeinfo_in_lib_p): Likewise.
471 * pt.c (tsubst): Likewise.
473 2010-10-13 Jason Merrill <jason@redhat.com>
476 * class.c (fixup_attribute_variants): New fn.
477 * cp-tree.h: Declare it.
478 * pt.c (instantiate_class_template): Call it.
479 * semantics.c (begin_class_definition): Call it.
481 2010-10-13 Richard Henderson <rth@redhat.com>
483 * cp-lang.c (cp_eh_personality): Update call to
484 build_personality_function.
485 * except.c (choose_personality_routine): Update function comment.
487 2010-10-13 Richard Guenther <rguenther@suse.de>
489 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
490 clear DECL_CHAIN of NAMESPACE_DECLs.
492 2010-10-11 Martin Jambor <mjambor@suse.cz>
495 * cp-tree.h (current_class_ref): Check that cp_function_chain is
497 * call.c (build_cxx_call): Likewise.
499 2010-10-10 Jason Merrill <jason@redhat.com>
501 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
502 (tsubst_default_arguments): Only do this once for cloned fns.
503 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
505 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
506 (tsubst_copy_and_build): Likewise.
507 (tsubst_initializer_list): Likewise.
508 (tsubst_copy): Change default to gcc_unreachable. Handle
509 OVERLOAD and PTRMEM_CST.
511 2010-10-10 Jason Merrill <jason@redhat.com>
515 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
517 2010-10-07 Andi Kleen <ak@linux.intel.com>
519 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
520 (cc1plus-dummy): Remove.
521 (cc1plus-checksum): Change to run checksum over object files
524 2010-10-08 Joseph Myers <joseph@codesourcery.com>
526 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
528 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
530 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
532 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
534 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
535 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
536 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
537 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
538 * parser.c (cp_parser_objc_encode_expression): Updated comment.
540 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
542 Merge from apple/trunk branch on FSF servers.
544 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
547 * parser.c (cp_parser_objc_interstitial_code): Recognize
548 and parse RID_NAMESPACE keyword.
550 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
552 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
553 finding ellipsis, before checking for attributes.
555 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
557 Merge from apple/trunk branch on FSF servers.
558 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
559 longer existing gcc/c-common.def.
561 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
564 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
565 * parser.c (cp_parser_objc_encode_expression): Build a templatized
566 parse tree for @encode(T).
568 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
571 * c-common.def: Add new expression code AT_ENCODE_EXPR.
573 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
576 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
577 code folding offsetof-like computations.
579 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
582 * parser.c (cp_parser_objc_class_interface): If no identifier
583 follows an @interface token, stop parsing the interface after
585 (cp_parser_objc_class_implementation): If no identifier follows an
586 @implementation token, stop parsing the implementation after
589 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
592 * parser.c (cp_parser_objc_method_keyword_params): If the required
593 colon is not found while parsing parameters, stop parsing them.
595 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
598 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
599 @end after detecting it. Print an error if @end is found without
601 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
602 detecting it. Fixed reading the next token when continuing
603 because of an error in a method signature. Print an error if EOF
604 is found without an '@end'.
605 (cp_parser_objc_method_definition_list): Same change.
607 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
609 Merge from apple/trunk branch on FSF servers:
611 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
614 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
615 method parameters and issue error.
616 (cp_parser_objc_method_definition_list): Check for invalid tokens
617 which cannot start a function definition.
619 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
622 * parser.c (cp_parser_objc_message_args): Check for missing message
623 arguments and syntax error.
625 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
628 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
631 2005-08-15 Ziemowit Laski <zlaski@apple.com>
634 * parser.c (cp_parser_objc_interstitial_code): Catch stray
635 '{' and '}' tokens and issue appropriate errors.
637 2005-08-02 Ziemowit Laski <zlaski@apple.com>
640 (cp_parser_statement_seq_opt): In addition to '}' and
641 end-of-file, a statement sequence may also be terminated
644 2010-10-05 Joseph Myers <joseph@codesourcery.com>
646 * cp-tree.h (cxx_print_error_function,
647 cxx_initialize_diagnostics): Declare using diagnostic_context
650 2010-10-04 Andi Kleen <ak@linux.intel.com>
652 * Make-lang.in (g++, cc1plus): Add + to build rule.
654 2010-10-04 Jason Merrill <jason@redhat.com>
656 * tree.c (decl_storage_duration): New.
657 * cp-tree.h: Declare it.
658 (duration_kind): Return values.
660 2010-10-03 Jason Merrill <jason@redhat.com>
662 * typeck.c (require_complete_type_sfinae): Add complain parm to...
663 (require_complete_type): ...this function.
664 (cp_build_array_ref, convert_arguments): Use it.
665 (convert_for_initialization, cp_build_modify_expr): Likewise.
666 * cp-tree.h: Declare it.
667 * call.c (build_over_call): Use it.
669 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
671 merge from FSF 'apple/trunk' branch.
672 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
675 * cp/parser.c (cp_parser_objc_interstitial_code): For
676 @optional/@required set the optional/required flag.
678 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
680 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
681 and indentation when finding an Objective-C++ CPP_AT_NAME token.
683 2010-09-29 Richard Guenther <rguenther@suse.de>
685 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
686 (CP_TYPE_CONTEXT): Similar.
687 (FROB_CONTEXT): Frob global_namespace to the global
688 TRANSLATION_UNIT_DECL.
689 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
690 set DECL_CONTEXT of global_namespace to it.
691 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
692 instead of zeroing context.
693 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
694 (grokfndecl): Likewise.
695 (start_preparsed_function): Likewise.
696 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
697 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
698 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
699 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
700 (push_template_decl_real): Likewise.
701 (tsubst_friend_class): Likewise. Adjust context comparisons.
702 (instantiate_class_template): Use CP_TYPE_CONTEXT.
703 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
704 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
707 2010-09-29 Yao Qi <yao@codesourcery.com>
709 * decl.c (get_atexit_node): Fix typo.
711 2010-09-28 Jason Merrill <jason@redhat.com>
713 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
714 (real_lvalue_p): Take const_tree.
716 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
717 (cp_build_addr_expr_1): Likewise.
719 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
721 Partially merged from apple/trunk branch on FSF servers:
722 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
723 Radar 3803157 (method attributes)
725 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
726 (cp_parser_objc_method_tail_params_opt): Likewise.
727 (cp_parser_objc_method_signature): Likewise.
728 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
729 (cp_parser_objc_method_prototype_list): Handle attributes.
730 (cp_parser_objc_method_definition_list): Likewise.
732 2010-09-28 Richard Henderson <rth@redhat.com>
734 * cp-lang.c: Include "target.h".
735 (cp_eh_personality): Use targetm.except_unwind_info.
736 * Make-lang.in (cp-lang.o): Update deps.
738 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
740 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
741 (cp_parser_declaration): Parse prefix attributes for ObjC++.
742 (cp_parser_objc_protocol_declaration): Handle attributes.
743 (cp_parser_objc_class_interface): Likewise.
744 (cp_parser_objc_declaration): Likewise.
746 2010-09-27 Jason Merrill <jason@redhat.com>
748 Require lvalues as specified by the standard.
749 * typeck.c (lvalue_or_else): Use real_lvalue_p.
750 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
751 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
752 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
753 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
754 (build_const_cast_1): Adjust.
755 * cp-tree.h: Declare new fns.
756 * call.c (build_this, convert_like_real, build_over_call): Adjust.
757 (initialize_reference): Adjust.
758 * class.c (build_base_path, convert_to_base_statically): Adjust.
759 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
760 * cvt.c (build_up_reference, convert_to_reference): Adjust.
761 * decl.c (register_dtor_fn): Adjust.
762 * decl2.c (build_offset_ref_call_from_tree): Adjust.
763 * except.c (initialize_handler_parm): Adjust.
764 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
765 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
766 * tree.c (stabilize_expr): Adjust.
768 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
770 Merge from apple/trunk branch on FSF servers:
772 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
775 * typeck.c (composite_pointer_type): Call objc_have_common_type
776 when comparing two objective-c pointer types.
778 2005-07-18 Ziemowit Laski <zlaski@apple.com>
781 * call.c (standard_conversion): Do not issue warnings when
782 comparing ObjC pointer types.
784 2005-06-22 Ziemowit Laski <zlaski@apple.com>
787 * call.c (standard_conversion): Allow for a pointer conversion
788 between any two ObjC pointer types.
789 * typeck.c (composite_pointer_type): Determine common type
790 for two ObjC pointer types.
792 2010-09-24 Jan Hubicka <jh@suse.cz>
794 * decl.c (finish_function): Use decl_replaceable_p
795 * method.c (make_alias_for_thunk): Update call of
796 cgraph_same_body_alias.
798 2010-09-24 Jason Merrill <jason@redhat.com>
800 * decl.c (compute_array_index_type): Remember type dependence of
802 * pt.c (dependent_type_p_r): Don't recompute it here.
804 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
805 reference and pointer to the same type as "*" or "&".
807 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
809 * typeck.c (warn_args_num): Use warning 'too many arguments to
810 method [methodname]' for an Objective-C method instead of the less
811 satisfactory 'too many arguments to function' (with no method
814 2010-09-21 Jason Merrill <jason@redhat.com>
816 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
817 special handling if we know the member.
819 2010-09-18 Jason Merrill <jason@redhat.com>
821 * call.c (compare_ics): Do lvalue/rvalue reference binding
822 comparison for ck_list, too.
824 2010-09-15 Jason Merrill <jason@redhat.com>
826 * semantics.c (finish_id_expression): Diagnose use of function
827 parms in evaluated context outside function body.
829 * decl2.c (grokbitfield): Diagnose non-integral width.
831 * call.c (convert_like_real): Use the underlying type of the
832 reference for the temporary.
834 2010-09-15 Jakub Jelinek <jakub@redhat.com>
837 * class.c (build_vtbl_initializer): Use fn instead of init's operand
838 as first argument to FDESC_EXPR.
840 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
843 * decl.c (grokdeclarator): Check build_memfn_type return value
846 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
848 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
849 (begin_range_for_stmt): Likewise.
851 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
853 Implement range-based for-statements.
854 * cp-tree.def (RANGE_FOR_STMT): New.
855 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
856 (cp_convert_range_for): Declare.
857 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
858 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
859 * semantics.c (begin_range_for_stmt): New.
860 (finish_range_for_decl): New.
861 (finish_for_stmt): Accept also RANGE_FOR_STMT.
862 (perform_koenig_lookup): Add extra argument include_std.
863 * parser.c (cp_parser_c_for): New with code from
864 cp_parser_iteration_statement().
865 (cp_parser_range_for): New.
866 (cp_convert_range_for): New.
867 (cp_parser_iteration_statement): Add range-for support.
868 (cp_parser_condition): Adjust comment.
869 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
871 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
872 * cxx-pretty-print.c: Likewise.
873 * lex.c (cxx_init): Likewise.
874 * name-lookup.c (lookup_function_nonclass): Add extra argument
876 (lookup_arg_dependent): Likewise.
877 * name-lookup.h: Likewise.
879 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
882 * error.c (maybe_warn_cpp0x): Add new warning
883 CPP0X_INLINE_NAMESPACES.
884 * parser.c (cp_parser_namespace_definition): Likewise.
885 * cp-tree.h (cpp0x_warn_str): Likewise.
887 2010-09-10 Richard Guenther <rguenther@suse.de>
889 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
890 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
892 2010-09-10 Jan Hubicka <jh@suse.cz>
894 PR tree-optimization/45605
895 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
898 2010-09-08 Jakub Jelinek <jakub@redhat.com>
901 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
902 before calling fold_decl_constant_value.
904 2010-09-07 Arnaud Charlet <charlet@adacore.com>
906 * cp-tree.h (build_enumerator): Add new location_t parameter.
907 (build_lang_decl_loc): New function.
908 * decl.c (build_enumerator): New parameter loc. Use it when calling
909 build_decl. Replace build_lang_decl with build_lang_decl_loc.
910 * pt.c (tsubst_enum): Adjust call to build_enumerator.
911 * parser.c (cp_parser_enumerator_definition): Ditto.
912 * lex.c (build_lang_decl_loc): New function.
914 2010-09-06 Dodji Seketeli <dodji@redhat.com>
919 * tree.c (strip_typedefs): Strip typedefs from the context of
922 2010-09-06 Mark Mitchell <mark@codesourcery.com>
924 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
925 * call.c (build_conditional_expr): Likewise.
926 (convert_arg_to_ellipsis): Likewise.
928 2010-09-06 Arnaud Charlet <charlet@adacore.com>
930 * parser.c (make_pointer_declarator, make_reference_declarator,
931 make_call_declarator, make_array_declarator): Set declarator->id_loc.
932 (cp_parser_init_declarator): Adjust location of decl if appropriate.
934 2010-09-06 Jason Merrill <jason@redhat.com>
936 * call.c (implicit_conversion): Fix value-init of enums.
937 (convert_like_real): Likewise.
939 * decl.c (cp_finish_decl): Don't change init for auto deduction.
941 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
942 (fold_non_dependent_expr): ...here.
943 (convert_nontype_argument): Use it. Take complain parm.
944 Use perform_implicit_conversion instead of ocp_convert.
945 Allow cv-qual changes.
946 (convert_template_argument): Pass complain down.
947 (tsubst_template_arg): Suppress constant expression warnings.
950 * method.c (synthesized_method_walk): In constructors, also check
951 subobject destructors.
953 * semantics.c (finish_compound_literal): Always build a
956 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
959 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
961 2010-08-30 Jakub Jelinek <jakub@redhat.com>
964 * parser.c (cp_parser_omp_atomic): Handle boolean
965 {PRE,POST}_INCREMENT.
967 2010-08-29 Jason Merrill <jason@redhat.com>
970 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
971 after tentative parsing.
973 2010-08-22 Joseph Myers <joseph@codesourcery.com>
975 * Make-lang.in (g++spec.o): Update dependencies.
976 * g++spec.c: Include opts.h
977 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
978 (lang_specific_driver): Use cl_decoded_option structures.
980 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
982 * call.c: Use FOR_EACH_VEC_ELT.
987 * except.c: Likewise.
988 * mangle.c: Likewise.
989 * method.c: Likewise.
990 * name-lookup.c: Likewise.
991 * parser.c: Likewise.
994 * semantics.c: Likewise.
995 * typeck2.c: Likewise.
997 2010-08-19 Jason Merrill <jason@redhat.com>
999 * call.c (reference_related_p): Check for error_mark_node.
1000 (add_function_candidate): Check it instead of
1001 same_type_ignoring_top_level_qualifiers_p.
1004 * init.c (build_new_1): Don't use build_value_init in a template.
1005 (build_value_init): Make sure we don't.
1008 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
1009 of empty class CONSTRUCTOR.
1011 * except.c (pending_noexcept, pending_noexcept_checks): New.
1012 (perform_deferred_noexcept_checks): New.
1013 (maybe_noexcept_warning): Split from...
1014 (finish_noexcept_expr): ...here. Adjust.
1015 * decl2.c (cp_write_global_declarations): Call
1016 perform_deferred_noexcept_checks.
1017 * cp-tree.h: And declare it.
1019 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
1022 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
1025 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
1027 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
1028 or if -fms-extensions is enabled check, check permissive.
1030 2010-08-09 Jason Merrill <jason@redhat.com>
1033 * pt.c (lookup_template_class): Don't re-coerce outer parms.
1035 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1037 * call.c (add_builtin_candidates): Use VECs for local variable
1038 `types'. Adjust remainder of function accordingly.
1040 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1042 * name-lookup.c (is_associated_namespace): Convert local variables
1043 to be VECs instead of TREE_LISTs.
1045 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
1047 * tree.c (varargs_function_p): Use stdarg_p.
1049 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1051 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
1052 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
1053 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
1054 Change type to a VEC.
1055 (unparsed_funs_with_default_args): Define.
1056 (unparsed_funs_with_definitions): Define.
1057 (push_unparsed_function_queues): New function.
1058 (cp_parser_new): Call it.
1059 (pop_unparsed_function_queues): New function.
1060 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1061 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1062 (cp_parser_save_member_function_body): Likewise.
1063 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1064 and pop_unparsed_function_queues.
1065 (cp_parser_late_parsing_default_args): Likewise.
1066 (cp_parser_save_default_args): Use VEC_safe_push.
1068 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1070 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1072 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1074 * decl.c (poplevel): Adjust for type changes.
1075 (declare_local_label): Likewise.
1077 2010-08-06 Jason Merrill <jason@redhat.com>
1079 * typeck.c (complete_type_or_maybe_complain): Split out from...
1080 (complete_type_or_else): Here.
1081 (build_class_member_access_expr): Call it.
1082 (finish_class_member_access_expr): Likewise.
1083 * call.c (build_special_member_call): Likewise.
1084 * cvt.c (build_expr_type_conversion): Likewise.
1085 * init.c (build_new): Likewise.
1086 * typeck2.c (build_functional_cast): Likewise.
1087 * cp-tree.h: Declare it.
1089 * init.c (build_value_init): Add complain parm.
1090 (build_value_init_noctor): Likewise.
1091 (perform_member_init): Pass it.
1092 (expand_aggr_init_1): Likewise.
1093 (build_new_1): Likewise.
1094 (build_vec_init): Likewise.
1095 * pt.c (tsubst_expr): Likewise.
1096 * typeck2.c (build_functional_cast): Likewise.
1097 * cp-tree.h: Adjust.
1098 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1100 * typeck.c (decay_conversion): Any expression with type nullptr_t
1103 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1106 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1108 2010-07-27 Jason Merrill <jason@redhat.com>
1110 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1111 from build_value_init.
1112 * init.c (build_value_init_noctor): Give error for unknown array
1115 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1117 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1119 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1121 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1122 c_common_initialize_diagnostics.
1123 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1124 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1126 2010-07-21 Jason Merrill <jason@redhat.com>
1128 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1130 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1133 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1136 * pt.c (instantiate_class_template): Propagate the template's
1137 location to its instance.
1139 2010-07-20 Jason Merrill <jason@redhat.com>
1142 * pt.c (tsubst_copy_and_build): Rework last change.
1145 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1148 2010-07-19 Jason Merrill <jason@redhat.com>
1151 * semantics.c (finish_decltype_type): Correct decltype
1152 of parenthesized rvalue reference variable.
1155 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1156 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1158 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1161 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1163 * cp-tree.h: Adjust declaration.
1164 * init.c (perform_member_init): Adjust caller.
1165 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1166 * typeck2.c (store_init_value): Likewise.
1167 (build_functional_cast): Pass complain argument to
1168 build_x_compound_expr_from_list.
1170 2010-07-16 Jason Merrill <jason@redhat.com>
1173 * pt.c (process_partial_specialization): Diagnose partial
1174 specialization after instantiation.
1175 (most_specialized_class): Add complain parm.
1177 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1179 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1181 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1182 cp_build_function_call.
1184 2010-07-15 Jason Merrill <jason@redhat.com>
1187 * call.c (add_function_candidate): If we're working on an implicit
1188 declaration, don't consider candidates that won't match.
1189 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1190 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1193 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1194 (TYPE_HAS_USER_OPEQ): New.
1195 * decl.c (grok_special_member_properties): Set it.
1196 * class.c (add_implicitly_declared_members): Don't lazily declare
1197 constructors/operator= if a base or member has a user-declared one.
1198 (check_bases_and_members, check_bases): Adjust.
1199 (check_field_decls, check_field_decl): Adjust.
1201 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1203 * decl.c (integer_three_node): Remove.
1204 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1205 * cp-tree.h (integer_three_node): Remove.
1207 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1209 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1211 * class.c: Likewise.
1212 * cp-gimplify.c: Likewise.
1214 * decl2.c: Likewise.
1216 * mangle.c: Likewise.
1217 * name-lookup.c: Likewise.
1218 * optimize.c: Likewise.
1219 * parser.c: Likewise.
1222 * search.c: Likewise.
1223 * semantics.c: Likewise.
1224 * typeck.c: Likewise.
1225 * typeck2.c: Likewise.
1227 2010-07-14 Jason Merrill <jason@redhat.com>
1229 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1230 (build_field_list): Cache field type.
1232 Implement C++0x unrestricted unions (N2544)
1233 * class.c (check_field_decl): Loosen union handling in C++0x.
1234 * method.c (walk_field_subobs): Split out from...
1235 (synthesized_method_walk): ...here. Set msg before loops.
1236 (process_subob_fn): Check for triviality in union members.
1237 * init.c (sort_mem_initializers): Splice out uninitialized
1238 anonymous unions and union members.
1239 (push_base_cleanups): Don't automatically destroy anonymous unions
1242 2010-07-13 Jason Merrill <jason@redhat.com>
1245 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1246 (TYPE_HAS_USER_OPEQ): New.
1247 * decl.c (grok_special_member_properties): Set it.
1248 * class.c (add_implicitly_declared_members): Don't lazily declare
1249 constructors/operator= if a base or member has a user-declared one.
1250 (check_bases_and_members, check_bases): Adjust.
1251 (check_field_decls, check_field_decl): Adjust.
1252 * method.c (synthesized_method_walk): Initialize check_vdtor.
1255 * mangle.c (write_type): Canonicalize.
1256 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1257 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1259 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1262 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1264 * typeck.c (get_delta_difference): Update prototype, add a
1265 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1266 add checks for error_mark_node.
1267 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1268 parameter; update lookup_base call.
1269 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1270 parameter; update get_delta_difference call and add check for
1272 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1273 parameter; update get_delta_difference call and add check for
1274 error_mark_node; update build_ptrmemfunc call.
1275 (build_static_cast_1): Adjust convert_ptrmem call.
1276 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1277 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1278 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1279 and build_ptrmemfunc calls.
1280 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1282 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1285 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1286 adjust build_special_member_call call, pass complain.
1287 (convert_like_real): Adjust build_temp call, pass complain.
1289 2010-07-09 Jason Merrill <jason@redhat.com>
1292 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1293 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1294 Set BV_LOST_PRIMARY.
1295 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1297 2010-07-08 Jason Merrill <jason@redhat.com>
1300 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1301 virtual bases for covariant thunks.
1303 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1305 * cp-tree.h: Do not include toplev.h.
1307 2010-07-06 Jason Merrill <jason@redhat.com>
1310 * call.c (is_std_init_list): Look through typedefs.
1313 * init.c (build_offset_ref): If scope isn't dependent,
1314 don't exit early. Look at TYPE_MAIN_VARIANT.
1315 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1317 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1319 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1321 * cp-tree.h (impl_conv_void): New type.
1322 (convert_to_void): Adjust prototype.
1323 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1324 diagnostic for easy translation. Change caller.
1325 * typeck.c: Update call to convert_to_void.
1326 * semantics.c: Likewise.
1329 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1331 * decl.c (cp_finish_decl): Call add_local_decl.
1332 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1334 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1336 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1339 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1342 * parser.c (cp_parser_primary_expression): Error if local template is
1345 2010-07-02 Le-Chun Wu <lcwu@google.com>
1348 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1349 (variable or type) shadows another type.
1351 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1354 * typeck.c (convert_for_assignment): When converting a convertible
1355 vector type or objc++ types, call mark_rvalue_use.
1356 * typeck2.c (build_m_component_ref): Use return values from
1357 mark_rvalue_use or mark_lvalue_use.
1358 * class.c (build_base_path): Likewise.
1359 * call.c (build_conditional_expr): Likewise.
1361 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1364 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1367 2010-07-01 Richard Guenther <rguenther@suse.de>
1369 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1370 predicate we are looking for, allow non-gimplified
1373 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1376 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1377 arg is NULL_TREE too.
1378 * call.c (convert_class_to_reference): Return error_mark_node when
1381 2010-06-30 Michael Matz <matz@suse.de>
1383 * repo.c (finish_repo): Fix typo.
1385 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1387 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1389 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1391 * repo.c (pending_repo): Change type to a VEC.
1392 (finish_repo): Adjust for new type of pending_repo.
1393 (repo_emit_p): Likewise.
1395 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1397 * tree.c: Include gimple.h. Do not include tree-flow.h
1398 * decl.c: Do not include tree-flow.h
1399 * Make-lang.in: Adjust dependencies.
1401 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1403 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1404 (incomplete_vars): Adjust comment. Change type to a VEC.
1405 (maybe_register_incomplete_var): Adjust for new type.
1406 (complete_vars): Adjust iteration over incomplete_vars.
1408 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1410 * decl.c (struct named_label_entry): Change type of bad_decls field
1412 (poplevel_named_label_1): Adjust for new type of bad_decls.
1413 (check_goto): Likewise.
1415 2010-06-29 Jason Merrill <jason@redhat.com>
1417 Enable implicitly declared move constructor/operator= (N3053).
1418 * class.c (add_implicitly_declared_members): A class with no
1419 explicitly declared copy or move constructor gets both declared
1420 implicitly, and similarly for operator=.
1421 (check_bases): A type with no copy ctor does not inhibit
1422 a const copy ctor in a derived class. It does mean the derived
1424 (check_field_decl): Likewise.
1425 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1426 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1427 (trivially_copyable_p): Likewise.
1428 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1429 * class.c (finish_struct_bits): Likewise.
1430 * tree.c (build_target_expr_with_type): Likewise.
1431 * typeck2.c (store_init_value): Likewise.
1433 Enable implicitly deleted functions (N2346)
1434 * class.c (check_bases_and_members): Adjust lambda flags.
1435 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1437 * decl2.c (mark_used): Adjust error for use of deleted function.
1439 Machinery to support implicit delete/move.
1440 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1441 has_complex_move_ctor, has_complex_move_assign bitfields.
1442 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1443 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1444 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1445 (enum special_function_kind): Add sfk_move_assignment.
1446 (LOOKUP_SPECULATIVE): New.
1447 * call.c (build_over_call): Return early if it's set.
1448 (build_over_call): Use trivial_fn_p.
1449 * class.c (check_bases): If the base has no default constructor,
1450 the derived one is non-trivial. Handle move ctor/op=.
1451 (check_field_decl): Likewise.
1452 (check_bases_and_members): Handle move ctor/op=.
1453 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1454 (type_has_move_constructor, type_has_move_assign): New.
1455 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1456 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1457 (trivial_fn_p): New.
1458 (do_build_copy_constructor): Use it.
1459 (do_build_assign_ref): Likewise. Handle move assignment.
1460 (build_stub_type, build_stub_object, locate_fn_flags): New.
1461 (locate_ctor): Use locate_fn_flags.
1462 (locate_copy, locate_dtor): Remove.
1463 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1464 (process_subob_fn, synthesized_method_walk): New.
1465 (maybe_explain_implicit_delete): New.
1466 (implicitly_declare_fn): Use synthesized_method_walk,
1467 type_has_trivial_fn, and type_set_nontrivial_flag.
1468 (defaulted_late_check): Set DECL_DELETED_FN.
1469 (defaultable_fn_check): Handle sfk_move_assignment.
1470 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1471 implicitly deleted move ctor/op=.
1472 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1473 (lookup_fnfields_slot): New.
1474 * semantics.c (omp_clause_info_fndecl): Remove.
1475 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1476 get_copy_assign, trivial_fn_p.
1477 (trait_expr_value): Adjust call to locate_ctor.
1478 * tree.c (special_function_p): Handle sfk_move_assignment.
1480 * class.c (type_has_virtual_destructor): New.
1481 * cp-tree.h: Declare it.
1482 * semantics.c (trait_expr_value): Use it.
1484 * call.c (build_over_call): Only give warnings with tf_warning.
1486 * name-lookup.c (pop_scope): Handle NULL_TREE.
1488 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1489 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1490 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1491 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1492 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1493 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1494 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1495 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1496 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1497 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1498 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1499 * search.c, semantics.c, tree.c: Adjust.
1501 * pt.c (dependent_scope_ref_p): Remove.
1502 (value_dependent_expression_p): Don't call it.
1503 (type_dependent_expression_p): Here either.
1504 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1505 if the scope isn't dependent.
1507 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1511 * pt.c (has_value_dependent_address): New.
1512 (value_dependent_expression_p): Check it.
1513 (convert_nontype_argument): Likewise. Call decay_conversion before
1514 folding if we want a pointer.
1515 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1516 scope is the current instantiation.
1518 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1521 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1524 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1526 * init.c: Do not include except.h.
1529 * cp-lang.c: Likewise.
1531 * semantics.c: Likewise.
1532 * decl2.c: Likewise.
1533 * except.c: Likewise.
1534 (init_exception_processing): Do not set the removed
1535 lang_protect_cleanup_actions here.
1536 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1537 (doing_eh): New, moved from except.c but removed the do_warning flag.
1538 (expand_start_catch_block): Update doing_eh call.
1539 (expand_end_catch_block): Likewise.
1540 (build_throw): Likewise.
1541 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1542 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1543 cp_protect_cleanup_actions.
1544 * Make-lang.in: Update dependencies.
1546 2010-06-26 Jason Merrill <jason@redhat.com>
1548 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1549 constructor called with a single argument that takes a reference
1550 to the constructor's class.
1551 (BAD_CONVERSION_RANK): New.
1552 (compare_ics): Use it to compare bad ICSes.
1554 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1556 * lang-specs.h: Remove +e handling.
1558 2010-06-24 Andi Kleen <ak@linux.intel.com>
1560 * parser.c: (cp_parser_question_colon_clause):
1561 Switch to use cp_lexer_peek_token.
1562 Call warn_for_omitted_condop. Call pedwarn for omitted
1565 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1568 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1569 datum and mark_rvalue_use on component.
1572 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1573 the CALL_EXPR has no arguments.
1575 2010-06-21 Jason Merrill <jason@redhat.com>
1577 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1579 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1582 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1584 * name-lookup.c (struct arg_lookup): Convert namespaces and
1585 classes fields to VEC.
1586 (arg_assoc_namespace): Adjust for new type of namespaces.
1587 (arg_assoc_class): Adjust for new type of classes.
1588 (lookup_arg_dependent): Use make_tree_vector and
1589 release_tree_vector.
1590 * typeck2.c (build_x_arrow): Use vec_member.
1592 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1595 * error.c (dump_decl): Better wording for anonymous namespace.
1597 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1599 * class.c (build_vtbl_initializer): Adjust computation of new_position
1600 and which entry to add padding for.
1602 2010-06-16 Jason Merrill <jason@redhat.com>
1604 * except.c (check_noexcept_r): Return the problematic function.
1605 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1606 * pt.c (tsubst_copy_and_build): Pass it.
1607 * parser.c (cp_parser_unary_expression): Likewise.
1608 * cp-tree.h: Adjust prototype.
1610 * method.c (defaulted_late_check): Give the defaulted method
1611 the same exception specification as the implicit declaration.
1613 2010-06-15 Jason Merrill <jason@redhat.com>
1615 * class.c (add_implicitly_declared_members): Implicit assignment
1616 operators can also be virtual overriders.
1617 * method.c (lazily_declare_fn): Likewise.
1619 * call.c (convert_like_real): Give "initializing argument of"
1620 information for ambiguous conversion. Give source position
1623 * call.c (print_z_candidates): Do print viable deleted candidates.
1624 (joust): Don't choose a deleted function just because its worst
1625 conversion is better than another candidate's worst.
1627 * call.c (convert_like_real): Don't complain about
1628 list-value-initialization from an explicit constructor.
1630 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1631 DECL_SOURCE_LOCATION directly.
1633 * class.c (type_has_user_provided_default_constructor): Use
1636 * call.c (is_subseq): Handle ck_aggr, ck_list.
1637 (compare_ics): Treat an aggregate or ambiguous conversion to the
1638 same type as involving the same function.
1640 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1642 * typeck.c (convert_for_assignment): Fix comment. Change message
1643 format from %d to %qP.
1644 (convert_for_initialization): Fix comment.
1646 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1648 * cp-tree.h (expr_list_kind): New type.
1649 (impl_conv_rhs): New type.
1650 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1652 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1653 diagnostics for easy translation. Change caller.
1654 (convert_for_initialization): Use impl_conv_rhs and change caller.
1655 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1656 diagnostics for easy translation. Change caller.
1657 * decl.c (bad_spec_place): New enum.
1658 (bad_specifiers): Use it and emit the diagnostics for easy
1659 translation. Change caller.
1660 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1662 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1664 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1666 * decl2.c (cp_write_global_declarations): Adjust for new type of
1667 decl_namespace_list.
1668 * name-lookup.c (current_decl_namespace): Likewise.
1669 (push_decl_namespace): Likewise.
1670 (pop_decl_namespace): Likewise.
1672 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1674 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1675 instead of build_function_type.
1676 * decl.c (cxx_init_decl_processing): Likewise.
1677 (declare_global_var): Likewise.
1678 (get_atexit_node): Likewise.
1679 (expand_static_init): Likewise.
1680 * decl2.c (start_objects): Likewise.
1681 (start_static_storage_duration_function): Likewise.
1682 * except.c (init_exception_processing): Likewise.
1683 (build_exc_ptr): Likewise.
1684 (build_throw): Likewise.
1685 * rtti.c (throw_bad_cast): Likewise.
1686 (throw_bad_typeid): Likewise.
1687 (build_dynamic_cast_1): Likewise.
1689 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1691 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1692 (build_op_delete_call): Likewise.
1693 (build_over_call): Likewise.
1694 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1695 * pt.c (process_partial_specialization): Likewise.
1696 (tsubst_template_args): Likewise.
1697 * semantics.c (finish_asm_stmt): Likewise.
1699 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1701 * decl.c (record_key_method_defined): New, broken out of ...
1702 (finish_function): ... here. Call it.
1703 (start_decl): Treat aliases as definitions.
1705 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1707 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1709 * pt.c (maybe_process_partial_specialization): Likewise.
1710 (register_specialization): Likewise.
1711 (add_pending_template): Likewise.
1712 (lookup_template_class): Likewise.
1713 (push_tinst_level): Likewise.
1715 * parser.c (cp_lexer_new_main): Likewise.
1716 (cp_lexer_new_from_tokens): Likewise.
1717 (cp_token_cache_new): Likewise.
1718 (cp_parser_context_new): Likewise.
1719 (cp_parser_new): Likewise.
1720 (cp_parser_nested_name_specifier_opt): Likewise.
1721 (cp_parser_template_id): Likewise.
1723 * name-lookup.c (binding_entry_make): Likewise.
1724 (binding_table_construct): Likewise.
1725 (binding_table_new): Likewise.
1726 (cxx_binding_make): Likewise.
1727 (pushdecl_maybe_friend): Likewise.
1728 (begin_scope): Likewise.
1729 (push_to_top_level): Likewise.
1731 * lex.c (init_reswords): Likewise.
1732 (retrofit_lang_decl): Likewise.
1733 (cxx_dup_lang_specific_decl): Likewise.
1734 (copy_lang_type): Likewise.
1735 (cxx_make_type): Likewise.
1737 * decl.c (make_label_decl): Likewise.
1738 (check_goto): Likewise.
1739 (start_preparsed_function): Likewise.
1740 (save_function_data): Likewise.
1742 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1744 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1746 * class.c (finish_struct_1): Likewise.
1748 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1749 (struct lang_decl): Likewise.
1751 * parser.c (cp_parser_new): Update comment to not reference
1754 2010-06-07 Jason Merrill <jason@redhat.com>
1757 * error.c (dump_parameters): Mask out TFF_SCOPE.
1758 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1759 (dump_scope): Remove no-op mask.
1762 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1764 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1765 * init.c (build_offset_ref): Use it.
1766 * pt.c (maybe_process_partial_specialization): Use it.
1767 (instantiate_class_template): Use it.
1768 * search.c (lookup_base): Use it.
1770 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1773 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1774 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1775 handled_component_p.
1778 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1779 set also DECL_READ_P on the decl.
1781 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1784 * cp-tree.h (typedef_variant_p): Move this declaration to
1786 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1787 * decl.c (grokdeclarator): Do not rename debug info of an
1788 anonymous tagged type named by a typedef.
1790 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1793 * class.c (check_field_decls): Move the call to
1794 check_bitfield_decl before trying to set the
1795 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1797 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1799 * typeck.c: Update include path for moved files.
1802 * cp-gimplify.c: Likewise.
1803 * cp-lang.c: Likewise.
1805 * semantics.c: Likewise.
1806 * cxx-pretty-print.h: Likewise.
1807 * decl2.c: Likewise.
1808 * parser.c: Likewise.
1809 * cp-objcp-common.c: Likewise.
1810 * cp-tree.h: Likewise.
1811 * name-lookup.c: Likewise.
1813 * name-lookup.h: Likewise.
1814 * config-lang.in: Update paths in gtfiles for files in c-family/.
1815 * Make-lang.in: Likewise.
1817 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1819 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1820 * typeck.c (build_ptrmemfunc): Likewise.
1822 2010-06-04 Jason Merrill <jason@redhat.com>
1824 * typeck2.c (merge_exception_specifiers): Adjust merging of
1825 throw() and noexcept(true).
1827 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1828 using an uninitialized variable.
1830 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1831 (pp_cxx_expression): Likewise.
1833 Implement noexcept-specification (15.4)
1834 * parser.c (cp_parser_exception_specification_opt): Parse it.
1835 Give -Wdeprecated warning about throw() specs.
1836 * pt.c (tsubst_exception_specification): Handle it.
1837 * error.c (dump_exception_spec): Handle it.
1838 (dump_expr): Handle NOEXCEPT_EXPR.
1839 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1840 * typeck.c (comp_except_specs): Handle compatibility rules.
1841 Change exact parm to take an enum.
1842 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1843 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1844 (type_throw_all_p, build_noexcept_spec): New fns.
1845 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1846 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1847 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1848 (noexcept_true_spec, noexcept_false_spec): New macros.
1849 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1850 * search.c (check_final_overrider): Adjust.
1851 * decl.c (check_redeclaration_exception_specification): Adjust.
1852 (use_eh_spec_block): Use type_throw_all_p.
1853 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1854 Give operator new a noexcept-specification in C++0x mode.
1855 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1856 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1858 Implement noexcept operator (5.3.7)
1859 * cp-tree.def (NOEXCEPT_EXPR): New.
1860 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1861 * cp-tree.h: Declare finish_noexcept_expr.
1862 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1863 * pt.c (tsubst_copy_and_build): And tsubst it.
1864 (type_dependent_expression_p): Handle it.
1865 (value_dependent_expression_p): Handle it.
1867 * call.c (build_conditional_expr): Never fold in unevaluated context.
1868 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1869 * semantics.c (simplify_aggr_init_expr): Likewise.
1870 * typeck.c (merge_types): Call merge_exception_specifiers.
1871 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1872 DECL_ANTICIPATED for preferring new type.
1874 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1876 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1879 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1882 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1883 on object for static data members.
1885 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1886 Jason Merrill <jason@redhat.com>
1889 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1890 with the same type, call mark_lvalue_use on both.
1892 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1894 * class.c (struct vtbl_init_data_s): Remove last_init field.
1895 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1897 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1899 (build_vtt): Likewise.
1900 (initialize_vtable): Take a VEC instead of a tree.
1901 (build_vtt_inits): Change return type to void. Take a VEC **
1902 instead of a tree *; accumulate results into said VEC.
1903 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1904 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1905 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1907 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1908 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1910 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1911 rather than tree_cons.
1912 (build_vbase_offset_vtbl_entries): Likewise.
1913 (add_vcall_offset): Likewise.
1914 (build_rtti_vtbl_entries): Likewise.
1915 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1916 * decl.c (initialize_artificial_var): Use build_constructor instead
1917 of build_constructor_from_list.
1919 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1922 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1925 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1927 * parser.c (cp_parser_mem_initializer_list): Change error text.
1929 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1931 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1932 tree_decl_map hashtab from tree_map.
1933 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1934 (init_shadowed_var_for_decl): Adjust initialization.
1937 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1938 instead of calling mark_exp_read only when not an assignment.
1941 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1942 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1943 Set DECL_VALUE_EXPR on var.
1945 2010-06-02 Jason Merrill <jason@redhat.com>
1947 * error.c (dump_type): Improve typedef handling.
1952 * name-lookup.c (same_entity_p): New.
1953 (ambiguous_decl): Multiple declarations of the same entity
1956 2010-06-01 Jason Merrill <jason@redhat.com>
1959 * call.c (add_list_candidates): Prefer the default constructor.
1960 (build_aggr_conv): Treat missing initializers like { }.
1961 * typeck2.c (process_init_constructor_record): Likewise.
1962 * init.c (expand_default_init): Use digest_init for
1963 direct aggregate initialization, too.
1965 * call.c (add_list_candidates): Split out...
1966 (build_user_type_conversion_1): ...from here.
1967 (build_new_method_call): And here.
1968 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1971 * call.c (build_list_conv): Set list-initialization flags properly.
1973 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
1975 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1977 2010-06-01 Arnaud Charlet <charlet@adacore.com>
1978 Matthew Gingell <gingell@adacore.com>
1980 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1981 * decl2.c: Include langhooks.h and c-ada-spec.h.
1982 (cpp_check, collect_source_refs, collect_ada_namespace,
1983 collect_all_refs): New functions.
1984 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1985 * lang-specs.h: Ditto.
1987 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1989 * cp-tree.h (cp_build_function_call_nary): Declare.
1990 * typeck.c (cp_build_function_call_nary): Define.
1991 * decl.c (register_dtor_fn): Use it instead of
1992 cp_build_function_call.
1993 (cxx_maybe_build_cleanup): Likewise.
1994 * decl2.c (generate_ctor_or_dtor_function): Likewise.
1995 * except.c (do_get_exception_ptr): Likewise.
1996 (do_begin_catch): Likewise.
1997 (do_allocate_exception): Likewise.
1998 (do_free_exception): Likewise.
1999 (build_throw): Likewise. Use cp_build_function_call_vec instead
2000 of cp_build_function_call.
2001 (do_end_catch): Likewise.
2003 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
2005 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
2006 (struct cp_declarator): Move id_loc field up.
2008 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2010 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
2011 this file is included before c-common.h. Define GCC_DIAG_STYLE
2012 before including diagnostic-core.h and toplev.h.
2013 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
2014 * pt.c: Include cp-tree.h before c-common.h.
2016 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
2018 * tree.c (c_register_addr_space): Add stub.
2020 2010-05-28 Joseph Myers <joseph@codesourcery.com>
2022 * g++spec.c (lang_specific_driver): Use fatal_error instead of
2025 2010-05-28 Dodji Seketeli <dodji@redhat.com>
2027 Revert fix of PR c++/44188
2028 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
2030 * tree.c (typedef_variant_p): Revert moving this definition to
2032 * decl.c (grokdeclarator): Revert naming typedef handling.
2034 2010-05-27 Joseph Myers <joseph@codesourcery.com>
2036 * call.c: Include diagnostic-core.h instead of diagnostic.h.
2037 * cp-lang.c: Don't include diagnostic.h
2038 * name-lookup.c: Include diagnostic-core.h instead of
2040 (cp_emit_debug_info_for_using): Use seen_error.
2041 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
2042 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
2043 * pt.c (iterative_hash_template_arg): Use seen_error.
2044 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
2045 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
2046 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
2047 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
2050 2010-05-25 Dodji Seketeli <dodji@redhat.com>
2053 * cp-tree.h (typedef_variant_p): Move this declaration to
2055 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
2056 * decl.c (grokdeclarator): Do not rename debug info of an
2057 anonymous tagged type named by a typedef.
2059 2010-05-27 Jason Merrill <jason@redhat.com>
2062 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2065 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2068 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2069 * class.c (layout_class_type): Likewise.
2070 * decl.c (finish_enum): Likewise.
2071 * mangle.c (write_builitin_type): Likewise.
2073 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2075 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2077 * decl.c (grokdeclarator): Handle __int128.
2078 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2079 (cp_parser_simple_type_specifier): Likewise.
2080 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2081 * typeck.c (cp_common_type): Handle __int128.
2082 * mangle.c (integer_type_codes): Add itk_int128 and
2083 itk_unsigned_int128.
2085 2010-05-26 Jason Merrill <jason@redhat.com>
2088 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2091 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2093 * cp-lang.c: Do not include expr.h.
2095 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2097 * decl.c: Do not include rtl.h
2098 * semantics.c: Likewise.
2100 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2102 * cp-tree.h: Do not include splay-tree.h.
2103 (struct prtmem_cst): Remove unused field and false comment.
2104 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2105 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2106 * init.c: Do not include rtl.h and expr.h.
2107 * class.c: Do not include rtl.h. Include splay-tree.h.
2108 (build_clone): Use plain NULL instead of NULL_RTX.
2109 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2110 included. Include splay-tree.h.
2111 * method.c: Do not include rtl.h and expr.h.
2112 (use_thunk): Use plain NULL instead of NULL_RTX.
2113 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2114 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2115 and target.h. Include splay-tree.h.
2116 * expr.c: Do not include rtl.h and expr.h.
2117 * pt.c: Do not include obstack.h and rtl.h.
2118 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2119 (tsubst_decl): Likewise.
2120 (instantiate_decl): Likewise.
2121 * semantics.c: Do not include exprt.h and debug.h. Explain why
2122 rtl.h has to be included.
2123 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2124 * call.c: Do not include rtl.h and expr.h.
2125 * search.c: Do not include obstack.h and rtl.h.
2126 * friend.c: Do not include rtl.h and expr.h.
2127 * Make-lang.in: Update dependencies.
2129 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2132 * parser.c (non_integral_constant): Add NIC_NONE.
2133 (required_token): Add RT_NONE.
2134 (cp_parser_unary_expression): Initialize non_constant_p
2136 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2137 (cp_parser_primary_expression, cp_parser_postfix_expression,
2138 cp_parser_cast_expression, cp_parser_binary_expression,
2139 cp_parser_functional_cast): Fix formatting.
2141 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2144 * parser.c: Remove inclusion of dyn-string.h.
2145 (non_integral_constant): New enum.
2146 (name_lookup_error): New enum.
2147 (required_token): New enum.
2148 (cp_parser_required_error): New function.
2149 (cp_parser_require): Change the type of variable token_desc to
2150 required_token and use cp_parser_required_error.
2151 (cp_parser_require_keyword): Likewise.
2152 (cp_parser_error): Use gmsgid as parameter.
2153 (cp_parser_name_lookup_error): Change the type of variable desired to
2154 name_lookup_error and put the diagnostic in the full sentences. Change
2156 (cp_parser_non_integral_constant_expression): Change the type of the
2157 variable thing to non_integral_constant and put the diagnostics in
2158 full sentences. Change caller.
2160 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2163 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2165 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2167 * error.c (cp_diagnostic_starter): Update call to
2168 diagnostic_build_prefix.
2169 (cp_print_error_function,
2170 print_instantiation_partial_context_line): Check show_column flag
2173 2010-05-24 Jason Merrill <jason@redhat.com>
2176 * decl.c (check_initializer): Don't wrap an init-list in a
2178 * init.c (build_aggr_init): Don't assume copy-initialization if
2179 init has CONSTRUCTOR_IS_DIRECT_INIT.
2180 * call.c (build_new_method_call): Sanity check.
2182 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2184 * rtti.c (tinfo_base_init): Use build_constructor instead of
2185 build_constructor_from_list. Don't cons a tree node for
2187 (generic_initializer): Use build_constructor_single instead of
2188 build_constructor_from_list.
2189 (ptr_initializer): Use build_constructor instead of
2190 build_constructor_from_list
2191 (ptm_initializer): Likewise.
2192 (class_initializer): Likewise. Take varargs instead of TRAIL.
2193 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2194 build_constructor instead of build_constructor_from_list.
2196 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2198 * semantics.c: Include bitmap.h.
2199 * Make-lang.in: Update dependencies.
2201 2010-05-22 Jan Hubicka <jh@suse.cz>
2203 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2205 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2207 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2209 * cxx-pretty-print.c: Correct merge error.
2211 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2213 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2214 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2215 (cp_printer): Handle %K here using percent_K_format.
2216 * cxx-pretty-print.c: Include tree-pretty-print.h.
2217 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2220 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2222 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2223 Clean up redundant includes.
2225 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2228 * decl.c (xref_basetypes): Return false in case of ill-formed
2231 2010-05-19 Jason Merrill <jason@redhat.com>
2233 * call.c (reference_binding): Use cp_build_qualified_type_real
2234 and cp_type_quals consistently.
2235 (add_function_candidate): Likewise.
2236 (build_conditional_expr): Likewise.
2237 (convert_like_real): Likewise.
2238 (type_passed_as): Likewise.
2239 * class.c (add_method): Likewise.
2240 (same_signature_p): Likewise.
2241 (layout_class_type): Likewise.
2242 * decl.c (cxx_init_decl_processing): Likewise.
2243 (cp_fname_init): Likewise.
2244 (grokdeclarator): Likewise.
2245 * decl2.c (cp_reconstruct_complex_type): Likewise.
2246 * init.c (build_new_1): Likewise.
2247 * method.c (do_build_copy_constructor): Likewise.
2248 (implicitly_declare_fn): Likewise.
2249 * pt.c (tsubst_aggr_type): Likewise.
2251 * rtti.c (init_rtti_processing): Likewise.
2252 (build_headof): Likewise.
2253 (build_dynamic_cast_1): Likewise.
2254 (tinfo_base_init): Likewise.
2255 (emit_support_tinfos): Likewise.
2256 * semantics.c (capture_decltype): Likewise.
2257 * tree.c (cv_unqualified): Likewise.
2258 * typeck.c (composite_pointer_type): Likewise.
2259 (string_conv_p): Likewise.
2261 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2263 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2264 * decl.c (start_decl): Likewise.
2265 * semantics.c (finish_compound_literal): Likewise.
2266 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2267 (cp_type_readonly): Remove.
2268 * cp-tree.h: Remove declaration.
2270 * typeck.c (merge_types): Preserve memfn quals.
2272 * decl.c (grokdeclarator): Don't check quals on fn type.
2273 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2274 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2277 * typeck.c (type_memfn_quals): New fn.
2278 (apply_memfn_quals): New fn.
2279 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2280 (cp_type_readonly): Use cp_type_quals.
2281 * cp-tree.h: Add declarations.
2282 * tree.c (cp_build_qualified_type_real): Don't set, but do
2283 preserve, quals on FUNCTION_TYPE.
2284 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2285 * decl.c (build_ptrmem_type): Likewise.
2286 (grokdeclarator): Likewise.
2287 (static_fn_type): Likewise.
2288 * decl2.c (change_return_type): Likewise.
2289 (cp_reconstruct_complex_type): Likewise.
2290 * pt.c (tsubst_function_type): Likewise.
2292 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2294 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2296 * tree.c (build_min_non_dep_call_vec): Update comment.
2298 2010-05-17 Jason Merrill <jason@redhat.com>
2300 * call.c (struct z_candidate): Add explicit_targs field.
2301 (add_template_candidate_real): Set it.
2302 (build_over_call): Use it to control init-list warning.
2305 * call.c (build_over_call): Limit init-list deduction warning to
2306 cases where the argument is actually an init-list.
2309 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2311 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2312 Jason Merrill <jason@redhat.com>
2315 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2317 2010-05-15 Jason Merrill <jason@redhat.com>
2319 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2320 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2322 (finish_eh_spec_block): Adjust.
2324 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2327 * pt.c (tsubst): Unshare template argument.
2329 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2331 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2332 * Make-lang.in: Fix dependencies accordingly.
2334 2010-05-14 Jason Merrill <jason@redhat.com>
2337 * except.c (build_throw): Simplify, adjust for DR 475.
2340 * except.c (dtor_nothrow): Return nonzero for type with
2344 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2345 gimple_build_eh_must_not_throw.
2347 2010-05-14 Martin Jambor <mjambor@suse.cz>
2349 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2352 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2354 * call.c (build_new_method_call): Change warning text.
2355 * typeck2.c (build_functional_cast): Change error text.
2357 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2360 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2361 shadowing the outer parameter or variables by the declaration of
2362 nested function in nested structure or class. Warn the shadowing by
2363 the declaration of nested lambda expression.
2365 2010-05-13 Jason Merrill <jason@redhat.com>
2367 * typeck.c (cp_build_array_ref): Factor out from...
2368 (build_array_ref): ...here. Drop complain parm.
2369 (build_new_op): Adjust.
2370 * class.c (build_vtbl_ref_1): Adjust.
2371 * decl2.c (grok_array_decl): Adjust.
2372 * cp-tree.h: Adjust prototypes.
2374 2010-05-13 Jan Hubicka <jh@suse.cz>
2376 * decl.c (cp_finish_decl): Do not worry about used attribute.
2378 2010-05-12 Jason Merrill <jason@redhat.com>
2380 * typeck.c (build_array_ref): Take complain parm.
2381 * cp-tree.h: Add it to prototype.
2382 * call.c (build_new_op): Pass it.
2383 * class.c (build_vtbl_ref): Pass it.
2384 * decl2.c (grok_array_decl): Pass it.
2388 * cp-tree.def (NULLPTR_TYPE): Remove.
2389 * cp-tree.h (NULLPTR_TYPE_P): New.
2390 (SCALAR_TYPE_P): Use it.
2391 (nullptr_type_node): New.
2392 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2393 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2395 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2396 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2397 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2398 * mangle.c (write_type): Likewise.
2399 * name-lookup.c (arg_assoc_type): Likewise.
2400 * typeck.c (build_reinterpret_cast_1): Likewise.
2401 * rtti.c (typeinfo_in_lib_p): Likewise.
2402 (emit_support_tinfos): Remove local nullptr_type_node.
2404 * cp-tree.h (UNKNOWN_TYPE): Remove.
2405 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2406 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2407 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2408 * class.c (instantiate_type): Check unknown_type_node rather than
2410 * name-lookup.c (maybe_push_decl): Likewise.
2411 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2412 (get_typeid): Likewise.
2413 * semantics.c (finish_offsetof): Likewise.
2416 * call.c (add_template_candidate_real): If deduction fails, still
2417 add the template as a non-viable candidate.
2418 (equal_functions): Handle template candidates.
2419 (print_z_candidate): Likewise.
2420 (print_z_candidates): Likewise.
2421 (build_new_function_call): Likewise.
2423 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2424 * call.c (add_candidates): Enforce it.
2425 (build_new_method_call): Try non-list ctor if no viable list ctor.
2426 (build_user_type_conversion_1): Likewise.
2428 * call.c (add_candidates): Distinguish between type(x) and
2430 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2431 (build_new_method_call): Give better error for conversion op.
2433 * call.c (add_candidates): Add first_arg and return_type parms.
2434 Add special constructor/conversion op handling.
2435 (convert_class_to_reference): Use it.
2436 (build_user_type_conversion_1): Likewise.
2437 (build_op_call): Likewise.
2438 (build_new_method_call): Likewise.
2439 (build_new_op): Adjust.
2440 (perform_overload_resolution): Adjust.
2442 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2447 * pt.c (process_partial_specialization): Return error_mark_node
2448 in case of unused template parameters in partial specialization.
2450 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2453 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2454 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2455 look at its second operand.
2457 2010-05-10 Jason Merrill <jason@redhat.com>
2460 * semantics.c (baselink_for_fns): Revert earlier change.
2463 * typeck.c (cp_build_modify_expr): Complain about assignment to
2464 array from init list.
2466 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2469 * decl.c (check_initializer): strip array type before checking for
2470 uninitialized const or ref members.
2472 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2475 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2476 error count. Emit errors only if compain is true.
2477 (build_new_1): Do not return error_mark_node if
2478 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2479 errors. Delay the check for user-provided constructor.
2480 (perform_member_init): Adjust.
2481 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2484 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2485 Jason Merrill <jason@redhat.com>
2487 Add support for C++0x nullptr.
2488 * cp-tree.def: Add NULLPTR_TYPE.
2489 * cp-tree.h: Add nullptr_node.
2490 (cp_tree_index): Add CPTI_NULLPTR.
2491 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2492 * call.c (null_ptr_cst_p): Handle nullptr.
2493 (standard_conversion): Likewise.
2494 (convert_arg_to_ellipsis): Likewise.
2495 * mangle.c (write_type): Likewise.
2496 * name-lookup.c (arg_assoc_type): Likewise.
2497 * parser.c (cp_parser_primary_expression): Likewise.
2498 * typeck.c (cp_build_binary_op): Likewise.
2499 (build_reinterpret_cast_1): Likewise.
2500 * error.c (dump_type): Likewise.
2501 (dump_type_prefix, dump_type_suffix): Likewise.
2502 * decl.c (cxx_init_decl_processing): Likewise.
2503 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2504 * cvt.c (ocp_convert): Likewise.
2505 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2506 nullptr_t tinfo in libsupc++.
2508 2010-05-06 Jason Merrill <jason@redhat.com>
2510 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2512 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2513 Dodji Seketeli <dodji@redhat.com>
2516 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2518 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2519 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2520 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2521 (cp_build_unary_op): Call lvalue_use.
2522 * decl.c (unused_but_set_errorcount): New variable.
2523 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2524 (duplicate_decls): Merge DECL_READ_P flags.
2525 (start_cleanup_fn): Set DECL_READ_P flag.
2526 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2527 * tree.c (rvalue): Call rvalue_use.
2528 * pt.c (convert_nontype_argument): Likewise.
2529 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2530 finish_decltype_type): Likewise.
2531 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2532 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2533 or rvalue_use depending on the expr.
2534 * init.c (build_new, build_delete): Likewise.
2535 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2537 2010-05-05 Jason Merrill <jason@redhat.com>
2540 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2541 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2543 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2546 * pt.c (unify): Check each elt for error_mark_node.
2548 2010-05-04 Jason Merrill <jason@redhat.com>
2551 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2553 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2556 * call.c (build_new_method_call): Return error_mark_node if fns is
2559 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2562 * pt.c (most_specialized_class): Pretend we are processing
2563 a template decl during the call to coerce_template_parms.
2565 2010-05-03 Jason Merrill <jason@redhat.com>
2569 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2570 from the selected underlying type unless -fstrict-enums. Set
2571 ENUM_UNDERLYING_TYPE to have the restricted range.
2572 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2573 * class.c (check_bitfield_decl): Likewise.
2575 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2578 * init.c (build_new_1): Revert the accidental checkin in
2581 2010-04-30 Jason Merrill <jason@redhat.com>
2584 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2585 (pp_cxx_type_specifier_seq): ...here.
2587 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2589 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2590 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2592 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2595 * typeck.c (warn_args_num): New function.
2596 (convert_arguments): Use warn_args_num to print the diagnostic
2599 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2602 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2603 user-provided constructor while recursing.
2605 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2608 * error.c (print_instantiation_partial_context_line): Handle
2609 recursive instantiation.
2610 (print_instantiation_partial_context): Likewise.
2612 2010-04-27 Jason Merrill <jason@redhat.com>
2614 * init.c (perform_member_init): Check CLASS_TYPE_P.
2616 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2619 * init.c (perform_member_init): check for uninitialized const or
2620 reference members, including array types.
2622 2010-04-24 Jason Merrill <jason@redhat.com>
2624 * tree.c (get_fns): Split out from get_first_fn.
2625 * cp-tree.h: Declare it.
2626 * search.c (shared_member_p): Use it.
2627 * semantics.c (finish_qualified_id_expr): Simplify.
2628 (finish_id_expression): Simplify.
2630 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2631 whenever object is NULL_TREE. Don't do 'this' capture here.
2632 (finish_qualified_id_expr): Pass NULL_TREE.
2633 (finish_id_expression): Likewise.
2634 (lambda_expr_this_capture): Likewise.
2636 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2637 rather than checking current_class_ref directly.
2638 (finish_call_expr): Likewise.
2641 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2642 * class.c (current_nonlambda_class_type): New fn.
2643 * semantics.c (nonlambda_method_basetype): New.
2644 * cp-tree.h: Declare them.
2645 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2647 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2650 * semantics.c (lambda_return_type): Complain about
2654 * tree.c (cv_unqualified): Handle error_mark_node.
2657 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2658 if we don't want errors.
2661 * class.c (convert_to_base): Add complain parameter. Pass
2662 ba_quiet to lookup_base if we don't want errors.
2663 (build_vfield_ref): Pass complain to convert_to_base.
2664 * call.c (convert_like_real): Likewise.
2665 (initialize_reference): Likewise.
2666 (perform_direct_initialization_if_possible): Pass complain to
2668 * cp-tree.h: Adjust.
2670 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2671 Jason Merrill <jason@redhat.com>
2674 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2676 (check_initializer): Call it for classes that need constructing, too.
2677 * class.c (in_class_defaulted_default_constructor): New.
2678 * cp-tree.h: Declare it.
2680 2010-04-20 Jason Merrill <jason@redhat.com>
2683 * init.c (constant_value_1): Treat error_mark_node as a constant
2684 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2685 * cvt.c (ocp_convert): Handle getting error_mark_node from
2686 integral_constant_value.
2687 * decl.c (compute_array_index_type): Likewise.
2689 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2693 * typeck.c (incompatible_dependent_types_p): If one of the
2694 compared types if not a typedef then honour their main variant
2697 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2699 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2701 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2704 * typeck.c (structural_comptypes): Test dependent typedefs
2705 incompatibility before testing for their main variant based
2708 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2710 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2711 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2713 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2715 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2716 build_common_tree_nodes.
2718 2010-04-14 Jason Merrill <jason@redhat.com>
2721 * parser.c (cp_parser_parenthesized_expression_list): Change
2722 is_attribute_list parm to int to indicate whether or not to
2723 handle initial identifier specially.
2724 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2726 2010-04-13 Jason Merrill <jason@redhat.com>
2728 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2730 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2731 unevaluated context.
2732 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2734 2010-04-12 Jason Merrill <jason@redhat.com>
2737 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2738 return value directly.
2740 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2742 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2745 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2746 * init.c (build_new_1): Check for uninitialized const members and
2747 uninitialized reference members, when using new without
2748 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2749 (diagnose_uninitialized_cst_or_ref_member): Define, call
2750 diagnose_uninitialized_cst_or_ref_member_1.
2751 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2753 2010-04-12 Richard Guenther <rguenther@suse.de>
2756 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2757 template inline functions.
2759 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2762 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2765 2010-04-07 Jason Merrill <jason@redhat.com>
2768 * decl.c (start_preparsed_function): Do defer nested functions.
2770 PR c++/11094, DR 408
2771 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2772 * decl2.c (finish_static_data_member_decl): Set it.
2773 * decl.c (duplicate_decls): Propagate it.
2774 * pt.c (tsubst_decl): Don't substitute the domain of an array
2775 VAR_DECL if it's set.
2776 (regenerate_decl_from_template): Substitute it here.
2777 (type_dependent_expression_p): Return true if it's set.
2778 * semantics.c (finish_decltype_type): Instantiate such a variable.
2779 * typeck.c (cxx_sizeof_expr): Likewise.
2780 (strip_array_domain): New.
2783 * name-lookup.c (current_decl_namespace): Non-static.
2784 (pop_nested_namespace): Sanity check.
2785 * cp-tree.h: Declare current_decl_namespace.
2786 * decl.c (grokvardecl): Use it instead of current_namespace.
2787 (grokfndecl): Likewise.
2790 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2793 * pt.c (print_template_statistics): New.
2794 * cp-tree.h: Declare it.
2795 * tree.c (cxx_print_statistics): Call it.
2798 * decl.c (grokvardecl): Tweak warning message.
2799 (grokfndecl): Likewise.
2801 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2804 *pt.c (tsubst_decl): Get the arguments of a specialization from
2805 the specialization template, not from the most general template.
2807 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2810 * typeck2.c (process_init_constructor_record):
2811 value-initialize members that are are not explicitely
2814 2010-04-07 Jie Zhang <jie@codesourcery.com>
2817 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2818 when all of its elements are non-constant and have been split out.
2820 2010-04-06 Taras Glek <taras@mozilla.com>
2821 Jason Merrill <jason@redhat.com>
2823 * parser.c (cp_parser_class_specifier): Set class location to that
2824 of IDENTIFIER_NODE instead of '{' when possible.
2825 * semantics.c (begin_class_definition): Do not overide locations
2826 with less precise ones.
2828 2010-04-06 Jason Merrill <jason@redhat.com>
2831 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2834 * pt.c (maybe_update_decl_type): Check the return value from
2837 2010-04-01 Jason Merrill <jason@redhat.com>
2839 * decl.c (next_initializable_field): No longer static.
2840 * cp-tree.h: Declare it.
2841 * call.c (build_aggr_conv): Fail if there are more initializers
2842 than initializable fields.
2844 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2845 instead of void_zero_node.
2847 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2850 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2851 * pt.c (end_template_parm_list): Store sibling template parms of
2852 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2853 (push_template_decl_real): Don't store the containing template decl
2854 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2855 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2856 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2859 2010-03-30 Jason Merrill <jason@redhat.com>
2862 * pt.c (push_template_decl_real): Deal better with running out of
2863 scopes before running out of template parms.
2867 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2868 function parameter context. Don't print an error if parsing
2872 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2875 2010-03-26 Jason Merrill <jason@redhat.com>
2878 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2879 c++0x mode, but not other type-names.
2881 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2884 * pt.c (add_to_template_args): Support NULL ARGS;
2885 (most_specialized_class): call coerce_template_parms on
2886 template arguments passed to get_class_bindings. Use
2887 add_to_template_args.
2888 (unify): Handle VAR_DECLs.
2890 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2892 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2894 * pt.c (get_template_parms_at_level): Adjust.
2896 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2899 * cp-tree.h (get_template_parms_at_level): Declare ...
2900 * pt.c (get_template_parms_at_level): ... new function.
2901 * typeck.c (get_template_parms_of_dependent_type): If a template
2902 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2903 current_template_parms. Use get_template_parms_at_level. Remove
2905 (incompatible_dependent_types_p): If we get empty parms from just one
2906 of the template type parms we are comparing then the template parms are
2909 2010-03-24 Jason Merrill <jason@redhat.com>
2912 * parser.c (make_declarator): Initialize id_loc.
2913 (cp_parser_lambda_declarator_opt): And set it.
2915 2010-03-23 Jason Merrill <jason@redhat.com>
2917 Make lambda conversion op and op() non-static.
2918 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2919 Also add the thunk function returned by the conversion op.
2920 Mark the conversion deleted if the op() is variadic.
2921 * decl2.c (mark_used): Give helpful message about deleted conversion.
2922 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2923 * semantics.c (finish_this_expr): Adjust.
2924 * mangle.c (write_closure_type_name): Adjust.
2925 * decl.c (grok_op_properties): Don't allow it.
2926 * call.c (build_user_type_conversion_1): No static conversion ops.
2927 (build_op_call): Or op().
2929 * decl2.c (change_return_type): Fix 'this' quals.
2931 2010-03-22 Jason Merrill <jason@redhat.com>
2934 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2937 * pt.c (contains_auto_r): New fn.
2938 (do_auto_deduction): Use it.
2939 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2941 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
2944 * decl2.c (grokfield): Handle invalid initializers for member
2947 2010-03-20 Dodji Seketeli <dodji@redhat.com>
2950 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2952 * decl2.c (vague_linkage_p): Likewise.
2954 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2957 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2958 false, in the cp_parser_expression_statement call.
2960 2010-03-05 Jason Merrill <jason@redhat.com>
2962 * mangle.c (mangle_decl): Give name collision error even without
2965 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
2967 * pt.c (process_partial_specialization): Use error_n instead of
2970 2010-03-03 Jason Merrill <jason@redhat.com>
2973 * mangle.c (mangle_decl): Handle VAR_DECL, too.
2975 2010-03-03 Jason Merrill <jason@redhat.com>
2978 * mangle.c: Include cgraph.h.
2979 (mangle_decl): If the mangled name will change in a later
2980 ABI version, make the later mangled name an alias.
2981 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2982 * Make-lang.in (mangle.o): Depend on cgraph.h.
2983 * method.c (make_alias_for): Handle VAR_DECL, too.
2984 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2985 * tree.c (no_linkage_check): Adjust.
2986 * decl.c (maybe_commonize_var): Adjust.
2987 * cp-tree.h: Adjust.
2989 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
2991 * pt.c (redeclare_class_template): Use error_n and inform_n.
2993 2010-02-27 Mark Mitchell <mark@codesourcery.com>
2996 * cp-tree.h (push_tinst_level): Declare.
2997 (pop_tinst_level): Likewise.
2998 * pt.c (push_tinst_level): Give it external linkage.
2999 (pop_tinst_level): Likewise.
3000 * mangle.c (mangle_decl_string): Set the source location to that
3001 of the decl while mangling.
3003 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
3006 * pt.c (redeclare_class_template): Return false if there are erroneous
3007 template parameters.
3009 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
3011 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
3014 2010-02-24 Jason Merrill <jason@redhat.com>
3017 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
3019 * class.c (layout_class_type): Don't give -Wabi warning for a bug
3020 in a previous ABI version.
3022 2010-02-23 Jason Merrill <jason@redhat.com>
3025 * typeck2.c (digest_init_r): Accept value init of array.
3027 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
3030 * typeck.c (convert_arguments): Update error message.
3032 2010-02-22 Mike Stump <mikestump@comcast.net>
3035 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
3037 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
3040 * error.c (print_instantiation_partial_context_line): New.
3041 (print_instantiation_partial_context): Print at most 12 contexts,
3042 skip the rest with a message.
3044 2010-02-21 Dodji Seketeli <dodji@redhat.com>
3047 * pt.c (lookup_template_class): Better support of specialization
3048 of member of class template implicit instantiation.
3050 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
3053 * call.c (conversion_null_warnings): Replace -Wconversion with
3055 * cvt.c (build_expr_type_conversion): Likewise.
3057 2010-02-18 Jason Merrill <jason@redhat.com>
3060 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3063 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3065 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3066 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3069 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3073 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3074 (maybe_update_decl_type): New fn.
3075 * parser.c (cp_parser_init_declarator): Use it.
3078 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3080 2010-02-17 Jason Merrill <jason@redhat.com>
3083 * call.c (build_over_call): Don't create zero-sized assignments.
3084 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3085 * cp-objcp-common.c (cp_expr_size): Remove.
3086 * cp-tree.h: Remove prototype.
3089 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3090 decl we looked up doesn't match.
3093 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3094 have an INIT_EXPR anymore.
3097 * pt.c (convert_nontype_argument): Change assert to test.
3099 2010-02-16 Jason Merrill <jason@redhat.com>
3101 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3104 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3105 VIEW_CONVERT_EXPR for conversions between structural equality types
3106 that the back end can't tell are the same.
3109 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3110 cv-quals from element here.
3111 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3113 2010-02-14 Jason Merrill <jason@redhat.com>
3116 * semantics.c (finish_compound_literal): Use
3117 cp_apply_type_quals_to_decl when creating a static variable.
3119 2010-02-12 Jason Merrill <jason@redhat.com>
3122 * name-lookup.h (current_binding_level): Check for null
3125 2010-02-12 Jason Merrill <jason@redhat.com>
3128 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3130 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3133 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3136 2010-02-10 Jason Merrill <jason@redhat.com>
3139 * semantics.c (outer_lambda_capture_p): Revert.
3140 (add_capture): Only finish_member_declaration if
3141 we're in the lambda class.
3142 (register_capture_members): New.
3143 * cp-tree.h: Declare it.
3144 * parser.c (cp_parser_lambda_expression): Call it.
3146 2010-02-10 Jason Merrill <jason@redhat.com>
3149 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3150 instead of current_class_type.
3152 2010-02-10 Jason Merrill <jason@redhat.com>
3154 PR c++/42983, core issue 906
3155 * method.c (defaultable_fn_check): Check virtualness.
3157 2010-02-10 Jason Merrill <jason@redhat.com>
3160 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3162 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3164 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3165 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3167 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3168 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3169 (cp_parser_parameter_declaration)
3170 (cp_parser_exception_specification_opt)
3171 (cp_parser_exception_declaration): Likewise.
3172 * pt.c (check_default_tmpl_args): Likewise.
3173 * search.c (lookup_field_r): Likewise.
3175 2010-02-09 Jason Merrill <jason@redhat.com>
3178 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3180 2010-02-09 Jason Merrill <jason@redhat.com>
3183 * decl2.c (change_return_type): New fn.
3184 * semantics.c (apply_lambda_return_type): Use it.
3185 * cp-tree.h: Declare it.
3187 2010-02-05 Richard Guenther <rguenther@suse.de>
3189 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3190 * cp-lang.c: Include gt-cp-cp-lang.h.
3191 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3193 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3196 * typeck.c (get_template_parms_of_dependent_type): Try getting
3197 the template parameters fromt the type itself first.
3199 2010-02-03 Jason Merrill <jason@redhat.com>
3203 * mangle.c (write_unqualified_id): Split out from write_expression.
3204 (write_unqualified_name): Call it.
3205 (write_member_name): Likewise.
3206 (write_expression): Support TEMPLATE_ID_EXPR.
3207 Disambiguate operator names.
3210 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3213 2010-02-02 Jason Merrill <jason@redhat.com>
3216 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3217 * optimize.c (clone_body): Remap their initializers when making base
3219 (maybe_clone_body): Complain if multiple clones aren't safe.
3221 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3228 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3229 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3230 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3231 * pt.c (coerce_template_parms, type_unification_real,
3232 expand_template_argument_pack, coerce_template_parameter_pack):
3233 Set the non default template args count.
3234 (current_template_args): Always set non defaulted
3235 template args count when compiled with --enable-checking
3236 (tsubst_template_args, type_unification_real): Propagate the non
3237 defaulted template args count.
3238 * error.c (get_non_default_template_args_count): Renamed
3239 count_non_default_template_args into this. Don't calculate the
3240 non default template argument count anymore. Use the new
3241 accessor macros above to get it.
3242 (dump_template_argument_list, dump_type, dump_decl,
3243 dump_template_parms): Adjust.
3244 * parser.c (cp_parser_template_argument_list): Always set defaulted
3245 template args count when compiled with --enable-checking.
3247 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3249 * decl.c (redeclaration_error_message): Wrap the return messages into
3250 G_() for easy translation.
3252 2010-01-28 Jason Merrill <jason@redhat.com>
3255 * semantics.c (begin_class_definition): Don't use type_as_string.
3257 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3261 * typeck.c (get_template_parms_of_dependent_type): Factorized
3262 this out of incompatible_template_type_parms_p
3263 (incompatible_dependent_types_p): Renamed
3264 incompatible_template_type_parms_p into this. Make it detect
3265 two incompatible dependent typedefs too.
3266 (structural_comptypes): Use incompatible_dependent_types_p.
3267 * pt.c (get_template_info):
3268 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3270 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3271 Jason Merrill <jason@redhat.com>
3273 * mangle.c (write_type): Mangle transparent record as member type.
3274 * semantics.c (begin_class_definition): Recognize decimal classes
3275 and set TYPE_TRANSPARENT_AGGR.
3277 2010-01-20 Jason Merrill <jason@redhat.com>
3280 * mangle.c (write_expression): Handle tree codes that have extra
3281 arguments in the middle-end.
3283 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3286 * except.c (expand_start_catch_block): Deal correctly with
3287 do_begin_catch returning error_mark_node.
3289 2010-01-20 Jason Merrill <jason@redhat.com>
3292 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3296 * semantics.c (build_lambda_object): Call mark_used on captured
3300 * decl.c (grokdeclarator): Clear type_quals for a member function
3301 declared using a typedef. Don't complain about adding cv-quals
3302 to a function typedef in C++0x mode.
3304 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3306 * decl.c (create_array_type_for_decl): Remove set but not used
3307 variable error_msg. Remove break stmts after return stmts.
3309 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3311 * error.c (dump_template_parms, count_non_default_template_args):
3312 Revert fix of PR c++/42634.
3314 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3317 * error.c (dump_template_parms): Use innermost template
3318 arguments before calling count_non_default_template_args.
3319 (count_non_default_template_args): We are being called with
3320 template innermost arguments now. There is no need to ensure
3323 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3326 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3328 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3331 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3333 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3336 *pt.c (tsubst_decl): Get the arguments of a specialization from
3337 the specialization template, not from the most general template.
3339 2010-01-16 Jason Merrill <jason@redhat.com>
3342 * semantics.c (finish_decltype_type): Within a template, treat
3343 unresolved CALL_EXPR as dependent.
3345 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3347 * error.c (dump_template_parms,count_non_default_template_args):
3348 Revert changes of PR c++/42634.
3350 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3353 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3354 functions with noreturn attribute.
3356 2010-01-14 Jason Merrill <jason@redhat.com>
3359 * call.c (build_new_method_call): Don't free the vec here.
3362 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3364 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3367 * error.c (dump_template_parms): Use innermost template
3368 arguments before calling count_non_default_template_args.
3369 (count_non_default_template_args): We are being called with
3370 template innermost arguments now. There is no need to ensure
3373 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3376 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3377 arguments that were previously deduced.
3379 2010-01-05 Jason Merrill <jason@redhat.com>
3381 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3382 * call.c (build_over_call): Don't complain about it.
3384 2010-01-04 Jason Merrill <jason@redhat.com>
3387 * pt.c (tsubst_decl): Don't apply type attributes in place.
3390 * semantics.c (describable_type): Remove decltype comment and
3395 Copyright (C) 2010 Free Software Foundation, Inc.
3397 Copying and distribution of this file, with or without modification,
3398 are permitted in any medium without royalty provided the copyright
3399 notice and this notice are preserved.