1 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
2 Jason Merrill <jason@redhat.com>
4 * semantics.c (constexpr_call): New datatype.
5 (constexpr_call_table): New global table.
6 (constexpr_call_hash): New.
7 (constexpr_call_equal): Likewise.
8 (maybe_initialize_constexpr_call_table): Likewise.
9 (lookup_parameter_binding): Likewise.
10 (cxx_eval_builtin_function_call): Likewise.
11 (cxx_bind_parameters_in_call): Likewise.
12 (cxx_eval_call_expression): Likewise.
13 (cxx_eval_unary_expression): Likewise.
14 (cxx_eval_binary_expression): Likewise.
15 (cxx_eval_conditional_expression): Likewise.
16 (cxx_eval_array_reference): Likewise.
17 (cxx_eval_component_reference): Likewise.
18 (cxx_eval_logical_expression): Likewise.
19 (cxx_eval_object_construction): Likewise.
20 (cxx_eval_constant_expression): Likewise.
21 (cxx_eval_indirect_ref): Likewise.
22 (cxx_constant_value): Likewise.
23 (cxx_eval_bare_aggregate): Likewise.
24 (adjust_temp_type): New.
25 (reduced_constant_expression_p): New.
26 (verify_constant): New.
27 (cxx_eval_vec_init, cxx_eval_vec_init_1): New.
28 (cxx_eval_outermost_constant_expr): New.
29 (maybe_constant_value, maybe_constant_init): New.
30 (cxx_eval_constant_expression): Use them.
31 * pt.c (iterative_hash_template_arg): No longer static.
32 * cp-tree.h: Declare fns.
34 * cp-tree.h (register_constexpr_fundef): Declare.
35 * decl.c (maybe_save_function_definition): New.
36 (finish_function): Use it.
37 * semantics.c (constexpr_fundef): New datatype.
38 (constexpr_fundef_table): New global table.
39 (constexpr_fundef_equal): New.
40 (constexpr_fundef_hash): Likewise.
41 (retrieve_constexpr_fundef): Likewise.
42 (validate_constexpr_fundecl): Store in the table.
43 (build_data_member_initialization): New fn.
44 (build_constexpr_constructor_member_initializers): New.
45 (register_constexpr_fundef): Define.
46 (is_this_parameter): New.
47 (get_function_named_in_call): Likewise.
48 (get_nth_callarg): Likewise.
49 (check_automatic_or_tls): New.
50 (morally_constexpr_builtin_function_p): New.
51 (potential_constant_expression): New.
53 2010-11-01 Jason Merrill <jason@redhat.com>
55 * decl2.c (decl_constant_var_p): New fn.
56 (decl_maybe_constant_var_p): New fn.
57 (mark_used): Rework instantiation of things needed for constant
59 * cp-tree.h: Declare new fns.
60 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
61 (always_instantiate_p): Use decl_maybe_constant_var_p.
62 (instantiate_decl): Don't defer constexpr functions.
63 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
64 * semantics.c (finish_id_expression): Use decl_constant_var_p.
65 Check for valid name in constant expr after mark_used.
67 2010-10-31 Jason Merrill <jason@redhat.com>
69 * class.c (is_really_empty_class): Work when type is not complete.
70 (synthesized_default_constructor_is_constexpr): New.
71 (add_implicitly_declared_members): Use it.
72 (type_has_constexpr_default_constructor): Likewise.
73 * cp-tree.h: Declare it.
74 * method.c (synthesized_method_walk): Use it.
76 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
77 * typeck.c (convert_for_assignment): Likewise.
79 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
80 message about constexpr without -std=c++0x.
82 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
85 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
87 * class.c (layout_vtable_decl): Call build_array_of_n_type.
88 (build_vtt, build_ctor_vtabl_group): Likewise.
90 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
92 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
93 * parser.c (cp_parser_objc_at_property_declaration): Removed
94 parsing of RID_COPIES and RID_IVAR. Updated call to
95 objc_add_property_declaration.
96 * typecheck.c (finish_class_member_access_expr): Call
97 objc_maybe_build_component_ref instead of objc_build_setter_call.
98 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
99 of objc_build_getter_call.
101 2010-10-27 Jason Merrill <jason@redhat.com>
103 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
104 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
105 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
106 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
107 (cp_parser_trait_expr): Likewise.
109 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
110 Jason Merrill <jason@redhat.com>
112 * decl.c (finish_case_label): Use decl_constant_value.
114 * method.c (synthesized_method_walk): Track constexprness too.
115 (process_subob_fn, walk_field_subobs): Likewise.
116 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
117 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
118 * class.c (add_implicitly_declared_members): Handle
119 constexpr default ctor.
121 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
122 Make sure a constexpr ctor has an empty body.
123 * class.c (type_has_constexpr_default_constructor): New.
124 * cp-tree.h: Declare it.
125 * init.c (perform_member_init): Complain about uninitialized
126 member in constexpr ctor.
127 (emit_mem_initializers): And uninitialized base.
128 * decl.c (check_tag_decl): Fix typo.
130 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
131 (is_valid_constexpr_fn): New fn.
132 (validate_constexpr_fundecl): Use it.
133 * decl.c (validate_constexpr_redeclaration): New.
134 (duplicate_decls): Use it.
135 (cp_finish_decl): Call validate_constexpr_fundecl and
136 ensure_literal_type_for_constexpr_object here.
137 (start_decl): Not here. Don't ICE on constexpr reference.
138 (check_for_uninitialized_const_var): Don't handle constexpr specially.
139 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
140 (check_static_variable_definition): Give friendly message about
142 (grokdeclarator): Complain about typedef and volatile with constexpr.
143 Reorganize. Give sorry about non-static data members in C++0x mode.
144 (start_preparsed_function): Check validate_constexpr_fundecl here.
145 (check_function_type): Not here.
146 * decl2.c (finish_static_data_member_decl): Don't complain about
148 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
149 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
150 (cp_parser_decl_specifier_seq): Handle it.
151 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
153 * class.c (check_bases): Propagate non-literality.
154 (check_field_decls): Likewise.
155 (finalize_literal_type_property): New.
156 (check_bases_and_members): Call it.
157 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
158 (lang_type_class): Add has_constexpr_ctor field.
159 (DECL_DECLARED_CONSTEXPR_P): Strip template.
160 * decl.c (grok_special_member_properties): Set
161 TYPE_HAS_CONSTEXPR_CTOR.
163 2010-10-27 Jason Merrill <jason@redhat.com>
165 * call.c (build_integral_nontype_arg_conv): New.
166 * cp-tree.h: Declare it.
167 * pt.c (convert_nontype_argument): Use it.
169 * error.c (dump_simple_decl): Print constexpr.
171 * cvt.c (build_up_reference): Use target_type for the temporary var.
173 * except.c (build_throw): Set EXPR_LOCATION.
175 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
177 * semantics.c (finish_compound_stmt): Avoid creating an
178 unnecessary BIND_EXPR.
180 * call.c (convert_like_real): Don't check narrowing if the element
181 is also an initializer-list.
183 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
185 * parser.c (cp_parser_objc_at_property_declaration): Recognize
186 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
187 Do not use objc_set_property_attr, but use local variables
188 instead. Detect repeated usage of setter, getter and ivar
189 attributes. Improved error processing when a setter name does not
190 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
191 that the token is a keyword. Updated call to
192 objc_add_property_declaration.
194 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
196 * parser.c (cp_parser_objc_property_decl): Renamed to
197 cp_parser_objc_struct_declaration. Return the parsed trees
198 instead of calling objc_add_property_variable directly. Detect
199 missing or invalid declspecs. Implemented attributes. Do not eat
200 the ';' at the end. Exit loop whenever a non-comma is parsed, not
202 (cp_parser_objc_at_property): Renamed to
203 cp_parser_objc_at_property_declaration. Updated calls to
204 objc_add_property_variable, now objc_add_property_declaration, and
205 to cp_parser_objc_property_decl, now
206 cp_parser_objc_struct_declaration. Rewritten all code to be more
207 robust in dealing with syntax errors, and almost identical to the
208 one in c_parser_objc_at_property_declaration.
209 (cp_parser_objc_property_attrlist): Removed.
210 (cp_parser_objc_method_prototype_list): Updated call to
211 cp_parser_objc_at_property.
212 (cp_parser_objc_method_definition_list): Same change.
213 (cp_parser_objc_class_ivars): Detect a number of invalid
214 declarations of instance variables and produce errors when they
217 2010-10-26 Jason Merrill <jason@redhat.com>
219 * tree.c (build_vec_init_expr): Split out from...
220 (build_array_copy): ...here.
221 * init.c (perform_member_init): Use it.
222 * cp-tree.h: Declare it.
223 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
224 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
225 (cp_gimplify_expr): Handle array default-initialization via
228 * tree.c (stabilize_expr): Handle xvalues properly.
230 * call.c (build_over_call): Use argarray[0] for 'this' argument.
232 * decl.c (finish_function): Don't look at function_depth.
234 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
236 Implement opaque-enum-specifiers for C++0x.
237 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
238 (OPAQUE_ENUM_P): New.
239 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
240 (start_enum): Update prototype.
241 (finish_enum_value_list): New prototype.
242 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
243 "enum class" is used in an elaborated-type-specifier.
244 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
245 * decl.c (copy_type_enum): New.
246 (finish_enum_value_list): New, with code from finish_enum.
247 (finish_enum): A lot of code removed. Added a gcc_assert.
248 (start_enum): Add parameters enumtype and is_new.
249 Rewrite to work with opaque-enum-specifiers.
250 * pt.c (maybe_process_partial_specialization): Allow for template
251 specialization of enumerations, with a pedwarn.
252 (lookup_template_class): Update call to start_enum. Call to
254 (tsubst_enum): Call to begin_scope, finish_scope and
255 finish_enum_value_list.
257 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
259 Removed Objective-C++ specific replacement of cxx_printable_name.
260 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
261 to cxx_printable_name for both C++ and Objective-C++.
262 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
264 * error.c (dump_decl): For Objective-C++, call
265 objc_maybe_printable_name here ...
266 * tree.c (cxx_printable_name_internal): ... instead of here.
268 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
270 * tree.c (cxx_printable_name_internal): In Objective-C++, call
271 objc_maybe_printable_name.
273 2010-10-22 Jason Merrill <jason@redhat.com>
276 * pt.c (instantiate_class_template): Don't instantiate default
280 * init.c (build_vec_init): Handle memberwise move.
282 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
285 * call.c (add_function_candidate): Don't use TREE_VALUE on null
288 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
290 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
291 bool instead of calling objc_set_method_type.
292 (cp_parser_objc_method_signature): Updated calls to
293 cp_parser_objc_method_type and to objc_build_method_signature.
294 (cp_parser_objc_method_prototype_list): Updated calls to
295 objc_add_method_declaration. Use token->type to determine if it
296 is a class method or not.
297 (cp_parser_objc_method_definition_list): Same change.
299 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
302 * parser.c (cp_convert_range_for): Call cp_finish_decl
303 instead of finish_expr_stmt.
305 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
307 * cp-lang.c (finish_file): Removed.
308 * decl2.c (cp_write_global_declarations): Call
309 objc_write_global_declarations when compiling Objective-C++.
311 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
314 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
315 (coerce_template_parms): Likewise for args.
317 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
319 Implemented parsing @synthesize and @dynamic for Objective-C++.
320 * parser.c (cp_parser_objc_method_definition_list): Recognize
321 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
322 (cp_parser_objc_at_dynamic_declaration): New.
323 (cp_parser_objc_at_synthesize_declaration): New.
325 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
327 * parser.c (cp_parser_objc_identifier_list): Check the return
328 value of cp_parser_identifier and react if it is error_mark_node.
330 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
332 Merge from apple/trunk branch on FSF servers.
334 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
337 * call.c (standard_conversion, implicit_conversion): Ignore
338 'volatile' attribute of artificially volatized type in objc when
339 evaluating various conversion weights.
341 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
344 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
345 artiificially 'volatized' type before doing pointer comparison.
347 2010-10-18 Jakub Jelinek <jakub@redhat.com>
350 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
353 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
355 Merge from apple/trunk branch on FSF servers.
357 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
360 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
361 objc object types if type is scope qualified.
363 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
365 Merge from apple/trunk branch on FSF servers.
367 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
370 * lex.c (unqualified_name_lookup_error): Issue diagnostic
371 for private 'ivar' access.
373 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
375 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
376 enum, and handle @package.
378 2010-10-15 Jason Merrill <jason@redhat.com>
381 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
382 with a different typedef variant of the element type.
384 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
386 merge from FSF apple 'trunk' branch.
387 2006 Fariborz Jahanian <fjahanian@apple.com>
389 Radars 4436866, 4505126, 4506903, 4517826
390 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
392 (cp_build_modify_expr): Likewise.
393 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
394 (cp_parser_objc_method_definition_list): Likewise.
395 (cp_parser_objc_property_decl): New.
396 (cp_parser_objc_property_attrlist): New.
397 (cp_parser_objc_at_property): New.
399 2010-10-14 Richard Guenther <rguenther@suse.de>
402 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
403 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
405 * error.c (dump_type): Handle NULLPTR_TYPE.
406 (dump_type_prefix): Likewise.
407 (dump_type_suffix): Likewise.
408 * mangle.c (write_type): Likewise.
409 * name-lookup.c (arg_assoc_type): Likewise.
410 * rtti.c (typeinfo_in_lib_p): Likewise.
411 * pt.c (tsubst): Likewise.
413 2010-10-13 Jason Merrill <jason@redhat.com>
416 * class.c (fixup_attribute_variants): New fn.
417 * cp-tree.h: Declare it.
418 * pt.c (instantiate_class_template): Call it.
419 * semantics.c (begin_class_definition): Call it.
421 2010-10-13 Richard Henderson <rth@redhat.com>
423 * cp-lang.c (cp_eh_personality): Update call to
424 build_personality_function.
425 * except.c (choose_personality_routine): Update function comment.
427 2010-10-13 Richard Guenther <rguenther@suse.de>
429 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
430 clear DECL_CHAIN of NAMESPACE_DECLs.
432 2010-10-11 Martin Jambor <mjambor@suse.cz>
435 * cp-tree.h (current_class_ref): Check that cp_function_chain is
437 * call.c (build_cxx_call): Likewise.
439 2010-10-10 Jason Merrill <jason@redhat.com>
441 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
442 (tsubst_default_arguments): Only do this once for cloned fns.
443 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
445 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
446 (tsubst_copy_and_build): Likewise.
447 (tsubst_initializer_list): Likewise.
448 (tsubst_copy): Change default to gcc_unreachable. Handle
449 OVERLOAD and PTRMEM_CST.
451 2010-10-10 Jason Merrill <jason@redhat.com>
455 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
457 2010-10-07 Andi Kleen <ak@linux.intel.com>
459 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
460 (cc1plus-dummy): Remove.
461 (cc1plus-checksum): Change to run checksum over object files
464 2010-10-08 Joseph Myers <joseph@codesourcery.com>
466 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
468 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
470 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
472 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
474 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
475 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
476 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
477 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
478 * parser.c (cp_parser_objc_encode_expression): Updated comment.
480 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
482 Merge from apple/trunk branch on FSF servers.
484 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
487 * parser.c (cp_parser_objc_interstitial_code): Recognize
488 and parse RID_NAMESPACE keyword.
490 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
492 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
493 finding ellipsis, before checking for attributes.
495 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
497 Merge from apple/trunk branch on FSF servers.
498 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
499 longer existing gcc/c-common.def.
501 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
504 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
505 * parser.c (cp_parser_objc_encode_expression): Build a templatized
506 parse tree for @encode(T).
508 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
511 * c-common.def: Add new expression code AT_ENCODE_EXPR.
513 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
516 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
517 code folding offsetof-like computations.
519 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
522 * parser.c (cp_parser_objc_class_interface): If no identifier
523 follows an @interface token, stop parsing the interface after
525 (cp_parser_objc_class_implementation): If no identifier follows an
526 @implementation token, stop parsing the implementation after
529 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
532 * parser.c (cp_parser_objc_method_keyword_params): If the required
533 colon is not found while parsing parameters, stop parsing them.
535 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
538 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
539 @end after detecting it. Print an error if @end is found without
541 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
542 detecting it. Fixed reading the next token when continuing
543 because of an error in a method signature. Print an error if EOF
544 is found without an '@end'.
545 (cp_parser_objc_method_definition_list): Same change.
547 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
549 Merge from apple/trunk branch on FSF servers:
551 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
554 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
555 method parameters and issue error.
556 (cp_parser_objc_method_definition_list): Check for invalid tokens
557 which cannot start a function definition.
559 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
562 * parser.c (cp_parser_objc_message_args): Check for missing message
563 arguments and syntax error.
565 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
568 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
571 2005-08-15 Ziemowit Laski <zlaski@apple.com>
574 * parser.c (cp_parser_objc_interstitial_code): Catch stray
575 '{' and '}' tokens and issue appropriate errors.
577 2005-08-02 Ziemowit Laski <zlaski@apple.com>
580 (cp_parser_statement_seq_opt): In addition to '}' and
581 end-of-file, a statement sequence may also be terminated
584 2010-10-05 Joseph Myers <joseph@codesourcery.com>
586 * cp-tree.h (cxx_print_error_function,
587 cxx_initialize_diagnostics): Declare using diagnostic_context
590 2010-10-04 Andi Kleen <ak@linux.intel.com>
592 * Make-lang.in (g++, cc1plus): Add + to build rule.
594 2010-10-04 Jason Merrill <jason@redhat.com>
596 * tree.c (decl_storage_duration): New.
597 * cp-tree.h: Declare it.
598 (duration_kind): Return values.
600 2010-10-03 Jason Merrill <jason@redhat.com>
602 * typeck.c (require_complete_type_sfinae): Add complain parm to...
603 (require_complete_type): ...this function.
604 (cp_build_array_ref, convert_arguments): Use it.
605 (convert_for_initialization, cp_build_modify_expr): Likewise.
606 * cp-tree.h: Declare it.
607 * call.c (build_over_call): Use it.
609 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
611 merge from FSF 'apple/trunk' branch.
612 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
615 * cp/parser.c (cp_parser_objc_interstitial_code): For
616 @optional/@required set the optional/required flag.
618 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
620 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
621 and indentation when finding an Objective-C++ CPP_AT_NAME token.
623 2010-09-29 Richard Guenther <rguenther@suse.de>
625 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
626 (CP_TYPE_CONTEXT): Similar.
627 (FROB_CONTEXT): Frob global_namespace to the global
628 TRANSLATION_UNIT_DECL.
629 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
630 set DECL_CONTEXT of global_namespace to it.
631 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
632 instead of zeroing context.
633 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
634 (grokfndecl): Likewise.
635 (start_preparsed_function): Likewise.
636 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
637 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
638 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
639 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
640 (push_template_decl_real): Likewise.
641 (tsubst_friend_class): Likewise. Adjust context comparisons.
642 (instantiate_class_template): Use CP_TYPE_CONTEXT.
643 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
644 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
647 2010-09-29 Yao Qi <yao@codesourcery.com>
649 * decl.c (get_atexit_node): Fix typo.
651 2010-09-28 Jason Merrill <jason@redhat.com>
653 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
654 (real_lvalue_p): Take const_tree.
656 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
657 (cp_build_addr_expr_1): Likewise.
659 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
661 Partially merged from apple/trunk branch on FSF servers:
662 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
663 Radar 3803157 (method attributes)
665 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
666 (cp_parser_objc_method_tail_params_opt): Likewise.
667 (cp_parser_objc_method_signature): Likewise.
668 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
669 (cp_parser_objc_method_prototype_list): Handle attributes.
670 (cp_parser_objc_method_definition_list): Likewise.
672 2010-09-28 Richard Henderson <rth@redhat.com>
674 * cp-lang.c: Include "target.h".
675 (cp_eh_personality): Use targetm.except_unwind_info.
676 * Make-lang.in (cp-lang.o): Update deps.
678 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
680 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
681 (cp_parser_declaration): Parse prefix attributes for ObjC++.
682 (cp_parser_objc_protocol_declaration): Handle attributes.
683 (cp_parser_objc_class_interface): Likewise.
684 (cp_parser_objc_declaration): Likewise.
686 2010-09-27 Jason Merrill <jason@redhat.com>
688 Require lvalues as specified by the standard.
689 * typeck.c (lvalue_or_else): Use real_lvalue_p.
690 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
691 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
692 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
693 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
694 (build_const_cast_1): Adjust.
695 * cp-tree.h: Declare new fns.
696 * call.c (build_this, convert_like_real, build_over_call): Adjust.
697 (initialize_reference): Adjust.
698 * class.c (build_base_path, convert_to_base_statically): Adjust.
699 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
700 * cvt.c (build_up_reference, convert_to_reference): Adjust.
701 * decl.c (register_dtor_fn): Adjust.
702 * decl2.c (build_offset_ref_call_from_tree): Adjust.
703 * except.c (initialize_handler_parm): Adjust.
704 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
705 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
706 * tree.c (stabilize_expr): Adjust.
708 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
710 Merge from apple/trunk branch on FSF servers:
712 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
715 * typeck.c (composite_pointer_type): Call objc_have_common_type
716 when comparing two objective-c pointer types.
718 2005-07-18 Ziemowit Laski <zlaski@apple.com>
721 * call.c (standard_conversion): Do not issue warnings when
722 comparing ObjC pointer types.
724 2005-06-22 Ziemowit Laski <zlaski@apple.com>
727 * call.c (standard_conversion): Allow for a pointer conversion
728 between any two ObjC pointer types.
729 * typeck.c (composite_pointer_type): Determine common type
730 for two ObjC pointer types.
732 2010-09-24 Jan Hubicka <jh@suse.cz>
734 * decl.c (finish_function): Use decl_replaceable_p
735 * method.c (make_alias_for_thunk): Update call of
736 cgraph_same_body_alias.
738 2010-09-24 Jason Merrill <jason@redhat.com>
740 * decl.c (compute_array_index_type): Remember type dependence of
742 * pt.c (dependent_type_p_r): Don't recompute it here.
744 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
745 reference and pointer to the same type as "*" or "&".
747 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
749 * typeck.c (warn_args_num): Use warning 'too many arguments to
750 method [methodname]' for an Objective-C method instead of the less
751 satisfactory 'too many arguments to function' (with no method
754 2010-09-21 Jason Merrill <jason@redhat.com>
756 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
757 special handling if we know the member.
759 2010-09-18 Jason Merrill <jason@redhat.com>
761 * call.c (compare_ics): Do lvalue/rvalue reference binding
762 comparison for ck_list, too.
764 2010-09-15 Jason Merrill <jason@redhat.com>
766 * semantics.c (finish_id_expression): Diagnose use of function
767 parms in evaluated context outside function body.
769 * decl2.c (grokbitfield): Diagnose non-integral width.
771 * call.c (convert_like_real): Use the underlying type of the
772 reference for the temporary.
774 2010-09-15 Jakub Jelinek <jakub@redhat.com>
777 * class.c (build_vtbl_initializer): Use fn instead of init's operand
778 as first argument to FDESC_EXPR.
780 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
783 * decl.c (grokdeclarator): Check build_memfn_type return value
786 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
788 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
789 (begin_range_for_stmt): Likewise.
791 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
793 Implement range-based for-statements.
794 * cp-tree.def (RANGE_FOR_STMT): New.
795 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
796 (cp_convert_range_for): Declare.
797 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
798 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
799 * semantics.c (begin_range_for_stmt): New.
800 (finish_range_for_decl): New.
801 (finish_for_stmt): Accept also RANGE_FOR_STMT.
802 (perform_koenig_lookup): Add extra argument include_std.
803 * parser.c (cp_parser_c_for): New with code from
804 cp_parser_iteration_statement().
805 (cp_parser_range_for): New.
806 (cp_convert_range_for): New.
807 (cp_parser_iteration_statement): Add range-for support.
808 (cp_parser_condition): Adjust comment.
809 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
811 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
812 * cxx-pretty-print.c: Likewise.
813 * lex.c (cxx_init): Likewise.
814 * name-lookup.c (lookup_function_nonclass): Add extra argument
816 (lookup_arg_dependent): Likewise.
817 * name-lookup.h: Likewise.
819 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
822 * error.c (maybe_warn_cpp0x): Add new warning
823 CPP0X_INLINE_NAMESPACES.
824 * parser.c (cp_parser_namespace_definition): Likewise.
825 * cp-tree.h (cpp0x_warn_str): Likewise.
827 2010-09-10 Richard Guenther <rguenther@suse.de>
829 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
830 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
832 2010-09-10 Jan Hubicka <jh@suse.cz>
834 PR tree-optimization/45605
835 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
838 2010-09-08 Jakub Jelinek <jakub@redhat.com>
841 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
842 before calling fold_decl_constant_value.
844 2010-09-07 Arnaud Charlet <charlet@adacore.com>
846 * cp-tree.h (build_enumerator): Add new location_t parameter.
847 (build_lang_decl_loc): New function.
848 * decl.c (build_enumerator): New parameter loc. Use it when calling
849 build_decl. Replace build_lang_decl with build_lang_decl_loc.
850 * pt.c (tsubst_enum): Adjust call to build_enumerator.
851 * parser.c (cp_parser_enumerator_definition): Ditto.
852 * lex.c (build_lang_decl_loc): New function.
854 2010-09-06 Dodji Seketeli <dodji@redhat.com>
859 * tree.c (strip_typedefs): Strip typedefs from the context of
862 2010-09-06 Mark Mitchell <mark@codesourcery.com>
864 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
865 * call.c (build_conditional_expr): Likewise.
866 (convert_arg_to_ellipsis): Likewise.
868 2010-09-06 Arnaud Charlet <charlet@adacore.com>
870 * parser.c (make_pointer_declarator, make_reference_declarator,
871 make_call_declarator, make_array_declarator): Set declarator->id_loc.
872 (cp_parser_init_declarator): Adjust location of decl if appropriate.
874 2010-09-06 Jason Merrill <jason@redhat.com>
876 * call.c (implicit_conversion): Fix value-init of enums.
877 (convert_like_real): Likewise.
879 * decl.c (cp_finish_decl): Don't change init for auto deduction.
881 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
882 (fold_non_dependent_expr): ...here.
883 (convert_nontype_argument): Use it. Take complain parm.
884 Use perform_implicit_conversion instead of ocp_convert.
885 Allow cv-qual changes.
886 (convert_template_argument): Pass complain down.
887 (tsubst_template_arg): Suppress constant expression warnings.
890 * method.c (synthesized_method_walk): In constructors, also check
891 subobject destructors.
893 * semantics.c (finish_compound_literal): Always build a
896 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
899 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
901 2010-08-30 Jakub Jelinek <jakub@redhat.com>
904 * parser.c (cp_parser_omp_atomic): Handle boolean
905 {PRE,POST}_INCREMENT.
907 2010-08-29 Jason Merrill <jason@redhat.com>
910 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
911 after tentative parsing.
913 2010-08-22 Joseph Myers <joseph@codesourcery.com>
915 * Make-lang.in (g++spec.o): Update dependencies.
916 * g++spec.c: Include opts.h
917 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
918 (lang_specific_driver): Use cl_decoded_option structures.
920 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
922 * call.c: Use FOR_EACH_VEC_ELT.
927 * except.c: Likewise.
928 * mangle.c: Likewise.
929 * method.c: Likewise.
930 * name-lookup.c: Likewise.
931 * parser.c: Likewise.
934 * semantics.c: Likewise.
935 * typeck2.c: Likewise.
937 2010-08-19 Jason Merrill <jason@redhat.com>
939 * call.c (reference_related_p): Check for error_mark_node.
940 (add_function_candidate): Check it instead of
941 same_type_ignoring_top_level_qualifiers_p.
944 * init.c (build_new_1): Don't use build_value_init in a template.
945 (build_value_init): Make sure we don't.
948 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
949 of empty class CONSTRUCTOR.
951 * except.c (pending_noexcept, pending_noexcept_checks): New.
952 (perform_deferred_noexcept_checks): New.
953 (maybe_noexcept_warning): Split from...
954 (finish_noexcept_expr): ...here. Adjust.
955 * decl2.c (cp_write_global_declarations): Call
956 perform_deferred_noexcept_checks.
957 * cp-tree.h: And declare it.
959 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
962 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
965 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
967 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
968 or if -fms-extensions is enabled check, check permissive.
970 2010-08-09 Jason Merrill <jason@redhat.com>
973 * pt.c (lookup_template_class): Don't re-coerce outer parms.
975 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
977 * call.c (add_builtin_candidates): Use VECs for local variable
978 `types'. Adjust remainder of function accordingly.
980 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
982 * name-lookup.c (is_associated_namespace): Convert local variables
983 to be VECs instead of TREE_LISTs.
985 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
987 * tree.c (varargs_function_p): Use stdarg_p.
989 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
991 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
992 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
993 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
994 Change type to a VEC.
995 (unparsed_funs_with_default_args): Define.
996 (unparsed_funs_with_definitions): Define.
997 (push_unparsed_function_queues): New function.
998 (cp_parser_new): Call it.
999 (pop_unparsed_function_queues): New function.
1000 (cp_parser_class_specifier): Adjust processing of unparsed functions.
1001 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
1002 (cp_parser_save_member_function_body): Likewise.
1003 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
1004 and pop_unparsed_function_queues.
1005 (cp_parser_late_parsing_default_args): Likewise.
1006 (cp_parser_save_default_args): Use VEC_safe_push.
1008 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
1010 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
1012 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
1014 * decl.c (poplevel): Adjust for type changes.
1015 (declare_local_label): Likewise.
1017 2010-08-06 Jason Merrill <jason@redhat.com>
1019 * typeck.c (complete_type_or_maybe_complain): Split out from...
1020 (complete_type_or_else): Here.
1021 (build_class_member_access_expr): Call it.
1022 (finish_class_member_access_expr): Likewise.
1023 * call.c (build_special_member_call): Likewise.
1024 * cvt.c (build_expr_type_conversion): Likewise.
1025 * init.c (build_new): Likewise.
1026 * typeck2.c (build_functional_cast): Likewise.
1027 * cp-tree.h: Declare it.
1029 * init.c (build_value_init): Add complain parm.
1030 (build_value_init_noctor): Likewise.
1031 (perform_member_init): Pass it.
1032 (expand_aggr_init_1): Likewise.
1033 (build_new_1): Likewise.
1034 (build_vec_init): Likewise.
1035 * pt.c (tsubst_expr): Likewise.
1036 * typeck2.c (build_functional_cast): Likewise.
1037 * cp-tree.h: Adjust.
1038 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1040 * typeck.c (decay_conversion): Any expression with type nullptr_t
1043 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1046 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1048 2010-07-27 Jason Merrill <jason@redhat.com>
1050 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1051 from build_value_init.
1052 * init.c (build_value_init_noctor): Give error for unknown array
1055 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1057 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1059 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1061 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1062 c_common_initialize_diagnostics.
1063 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1064 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1066 2010-07-21 Jason Merrill <jason@redhat.com>
1068 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1070 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1073 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1076 * pt.c (instantiate_class_template): Propagate the template's
1077 location to its instance.
1079 2010-07-20 Jason Merrill <jason@redhat.com>
1082 * pt.c (tsubst_copy_and_build): Rework last change.
1085 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1088 2010-07-19 Jason Merrill <jason@redhat.com>
1091 * semantics.c (finish_decltype_type): Correct decltype
1092 of parenthesized rvalue reference variable.
1095 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1096 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1098 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1101 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1103 * cp-tree.h: Adjust declaration.
1104 * init.c (perform_member_init): Adjust caller.
1105 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1106 * typeck2.c (store_init_value): Likewise.
1107 (build_functional_cast): Pass complain argument to
1108 build_x_compound_expr_from_list.
1110 2010-07-16 Jason Merrill <jason@redhat.com>
1113 * pt.c (process_partial_specialization): Diagnose partial
1114 specialization after instantiation.
1115 (most_specialized_class): Add complain parm.
1117 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1119 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1121 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1122 cp_build_function_call.
1124 2010-07-15 Jason Merrill <jason@redhat.com>
1127 * call.c (add_function_candidate): If we're working on an implicit
1128 declaration, don't consider candidates that won't match.
1129 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1130 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1133 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1134 (TYPE_HAS_USER_OPEQ): New.
1135 * decl.c (grok_special_member_properties): Set it.
1136 * class.c (add_implicitly_declared_members): Don't lazily declare
1137 constructors/operator= if a base or member has a user-declared one.
1138 (check_bases_and_members, check_bases): Adjust.
1139 (check_field_decls, check_field_decl): Adjust.
1141 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1143 * decl.c (integer_three_node): Remove.
1144 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1145 * cp-tree.h (integer_three_node): Remove.
1147 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1149 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1151 * class.c: Likewise.
1152 * cp-gimplify.c: Likewise.
1154 * decl2.c: Likewise.
1156 * mangle.c: Likewise.
1157 * name-lookup.c: Likewise.
1158 * optimize.c: Likewise.
1159 * parser.c: Likewise.
1162 * search.c: Likewise.
1163 * semantics.c: Likewise.
1164 * typeck.c: Likewise.
1165 * typeck2.c: Likewise.
1167 2010-07-14 Jason Merrill <jason@redhat.com>
1169 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1170 (build_field_list): Cache field type.
1172 Implement C++0x unrestricted unions (N2544)
1173 * class.c (check_field_decl): Loosen union handling in C++0x.
1174 * method.c (walk_field_subobs): Split out from...
1175 (synthesized_method_walk): ...here. Set msg before loops.
1176 (process_subob_fn): Check for triviality in union members.
1177 * init.c (sort_mem_initializers): Splice out uninitialized
1178 anonymous unions and union members.
1179 (push_base_cleanups): Don't automatically destroy anonymous unions
1182 2010-07-13 Jason Merrill <jason@redhat.com>
1185 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1186 (TYPE_HAS_USER_OPEQ): New.
1187 * decl.c (grok_special_member_properties): Set it.
1188 * class.c (add_implicitly_declared_members): Don't lazily declare
1189 constructors/operator= if a base or member has a user-declared one.
1190 (check_bases_and_members, check_bases): Adjust.
1191 (check_field_decls, check_field_decl): Adjust.
1192 * method.c (synthesized_method_walk): Initialize check_vdtor.
1195 * mangle.c (write_type): Canonicalize.
1196 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1197 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1199 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1202 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1204 * typeck.c (get_delta_difference): Update prototype, add a
1205 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1206 add checks for error_mark_node.
1207 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1208 parameter; update lookup_base call.
1209 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1210 parameter; update get_delta_difference call and add check for
1212 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1213 parameter; update get_delta_difference call and add check for
1214 error_mark_node; update build_ptrmemfunc call.
1215 (build_static_cast_1): Adjust convert_ptrmem call.
1216 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1217 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1218 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1219 and build_ptrmemfunc calls.
1220 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1222 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1225 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1226 adjust build_special_member_call call, pass complain.
1227 (convert_like_real): Adjust build_temp call, pass complain.
1229 2010-07-09 Jason Merrill <jason@redhat.com>
1232 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1233 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1234 Set BV_LOST_PRIMARY.
1235 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1237 2010-07-08 Jason Merrill <jason@redhat.com>
1240 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1241 virtual bases for covariant thunks.
1243 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1245 * cp-tree.h: Do not include toplev.h.
1247 2010-07-06 Jason Merrill <jason@redhat.com>
1250 * call.c (is_std_init_list): Look through typedefs.
1253 * init.c (build_offset_ref): If scope isn't dependent,
1254 don't exit early. Look at TYPE_MAIN_VARIANT.
1255 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1257 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1259 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1261 * cp-tree.h (impl_conv_void): New type.
1262 (convert_to_void): Adjust prototype.
1263 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1264 diagnostic for easy translation. Change caller.
1265 * typeck.c: Update call to convert_to_void.
1266 * semantics.c: Likewise.
1269 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1271 * decl.c (cp_finish_decl): Call add_local_decl.
1272 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1274 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1276 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1279 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1282 * parser.c (cp_parser_primary_expression): Error if local template is
1285 2010-07-02 Le-Chun Wu <lcwu@google.com>
1288 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1289 (variable or type) shadows another type.
1291 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1294 * typeck.c (convert_for_assignment): When converting a convertible
1295 vector type or objc++ types, call mark_rvalue_use.
1296 * typeck2.c (build_m_component_ref): Use return values from
1297 mark_rvalue_use or mark_lvalue_use.
1298 * class.c (build_base_path): Likewise.
1299 * call.c (build_conditional_expr): Likewise.
1301 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1304 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1307 2010-07-01 Richard Guenther <rguenther@suse.de>
1309 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1310 predicate we are looking for, allow non-gimplified
1313 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1316 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1317 arg is NULL_TREE too.
1318 * call.c (convert_class_to_reference): Return error_mark_node when
1321 2010-06-30 Michael Matz <matz@suse.de>
1323 * repo.c (finish_repo): Fix typo.
1325 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1327 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1329 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1331 * repo.c (pending_repo): Change type to a VEC.
1332 (finish_repo): Adjust for new type of pending_repo.
1333 (repo_emit_p): Likewise.
1335 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1337 * tree.c: Include gimple.h. Do not include tree-flow.h
1338 * decl.c: Do not include tree-flow.h
1339 * Make-lang.in: Adjust dependencies.
1341 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1343 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1344 (incomplete_vars): Adjust comment. Change type to a VEC.
1345 (maybe_register_incomplete_var): Adjust for new type.
1346 (complete_vars): Adjust iteration over incomplete_vars.
1348 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1350 * decl.c (struct named_label_entry): Change type of bad_decls field
1352 (poplevel_named_label_1): Adjust for new type of bad_decls.
1353 (check_goto): Likewise.
1355 2010-06-29 Jason Merrill <jason@redhat.com>
1357 Enable implicitly declared move constructor/operator= (N3053).
1358 * class.c (add_implicitly_declared_members): A class with no
1359 explicitly declared copy or move constructor gets both declared
1360 implicitly, and similarly for operator=.
1361 (check_bases): A type with no copy ctor does not inhibit
1362 a const copy ctor in a derived class. It does mean the derived
1364 (check_field_decl): Likewise.
1365 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1366 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1367 (trivially_copyable_p): Likewise.
1368 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1369 * class.c (finish_struct_bits): Likewise.
1370 * tree.c (build_target_expr_with_type): Likewise.
1371 * typeck2.c (store_init_value): Likewise.
1373 Enable implicitly deleted functions (N2346)
1374 * class.c (check_bases_and_members): Adjust lambda flags.
1375 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1377 * decl2.c (mark_used): Adjust error for use of deleted function.
1379 Machinery to support implicit delete/move.
1380 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1381 has_complex_move_ctor, has_complex_move_assign bitfields.
1382 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1383 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1384 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1385 (enum special_function_kind): Add sfk_move_assignment.
1386 (LOOKUP_SPECULATIVE): New.
1387 * call.c (build_over_call): Return early if it's set.
1388 (build_over_call): Use trivial_fn_p.
1389 * class.c (check_bases): If the base has no default constructor,
1390 the derived one is non-trivial. Handle move ctor/op=.
1391 (check_field_decl): Likewise.
1392 (check_bases_and_members): Handle move ctor/op=.
1393 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1394 (type_has_move_constructor, type_has_move_assign): New.
1395 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1396 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1397 (trivial_fn_p): New.
1398 (do_build_copy_constructor): Use it.
1399 (do_build_assign_ref): Likewise. Handle move assignment.
1400 (build_stub_type, build_stub_object, locate_fn_flags): New.
1401 (locate_ctor): Use locate_fn_flags.
1402 (locate_copy, locate_dtor): Remove.
1403 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1404 (process_subob_fn, synthesized_method_walk): New.
1405 (maybe_explain_implicit_delete): New.
1406 (implicitly_declare_fn): Use synthesized_method_walk,
1407 type_has_trivial_fn, and type_set_nontrivial_flag.
1408 (defaulted_late_check): Set DECL_DELETED_FN.
1409 (defaultable_fn_check): Handle sfk_move_assignment.
1410 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1411 implicitly deleted move ctor/op=.
1412 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1413 (lookup_fnfields_slot): New.
1414 * semantics.c (omp_clause_info_fndecl): Remove.
1415 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1416 get_copy_assign, trivial_fn_p.
1417 (trait_expr_value): Adjust call to locate_ctor.
1418 * tree.c (special_function_p): Handle sfk_move_assignment.
1420 * class.c (type_has_virtual_destructor): New.
1421 * cp-tree.h: Declare it.
1422 * semantics.c (trait_expr_value): Use it.
1424 * call.c (build_over_call): Only give warnings with tf_warning.
1426 * name-lookup.c (pop_scope): Handle NULL_TREE.
1428 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1429 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1430 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1431 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1432 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1433 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1434 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1435 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1436 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1437 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1438 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1439 * search.c, semantics.c, tree.c: Adjust.
1441 * pt.c (dependent_scope_ref_p): Remove.
1442 (value_dependent_expression_p): Don't call it.
1443 (type_dependent_expression_p): Here either.
1444 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1445 if the scope isn't dependent.
1447 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1451 * pt.c (has_value_dependent_address): New.
1452 (value_dependent_expression_p): Check it.
1453 (convert_nontype_argument): Likewise. Call decay_conversion before
1454 folding if we want a pointer.
1455 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1456 scope is the current instantiation.
1458 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1461 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1464 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1466 * init.c: Do not include except.h.
1469 * cp-lang.c: Likewise.
1471 * semantics.c: Likewise.
1472 * decl2.c: Likewise.
1473 * except.c: Likewise.
1474 (init_exception_processing): Do not set the removed
1475 lang_protect_cleanup_actions here.
1476 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1477 (doing_eh): New, moved from except.c but removed the do_warning flag.
1478 (expand_start_catch_block): Update doing_eh call.
1479 (expand_end_catch_block): Likewise.
1480 (build_throw): Likewise.
1481 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1482 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1483 cp_protect_cleanup_actions.
1484 * Make-lang.in: Update dependencies.
1486 2010-06-26 Jason Merrill <jason@redhat.com>
1488 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1489 constructor called with a single argument that takes a reference
1490 to the constructor's class.
1491 (BAD_CONVERSION_RANK): New.
1492 (compare_ics): Use it to compare bad ICSes.
1494 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1496 * lang-specs.h: Remove +e handling.
1498 2010-06-24 Andi Kleen <ak@linux.intel.com>
1500 * parser.c: (cp_parser_question_colon_clause):
1501 Switch to use cp_lexer_peek_token.
1502 Call warn_for_omitted_condop. Call pedwarn for omitted
1505 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1508 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1509 datum and mark_rvalue_use on component.
1512 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1513 the CALL_EXPR has no arguments.
1515 2010-06-21 Jason Merrill <jason@redhat.com>
1517 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1519 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1522 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1524 * name-lookup.c (struct arg_lookup): Convert namespaces and
1525 classes fields to VEC.
1526 (arg_assoc_namespace): Adjust for new type of namespaces.
1527 (arg_assoc_class): Adjust for new type of classes.
1528 (lookup_arg_dependent): Use make_tree_vector and
1529 release_tree_vector.
1530 * typeck2.c (build_x_arrow): Use vec_member.
1532 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1535 * error.c (dump_decl): Better wording for anonymous namespace.
1537 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1539 * class.c (build_vtbl_initializer): Adjust computation of new_position
1540 and which entry to add padding for.
1542 2010-06-16 Jason Merrill <jason@redhat.com>
1544 * except.c (check_noexcept_r): Return the problematic function.
1545 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1546 * pt.c (tsubst_copy_and_build): Pass it.
1547 * parser.c (cp_parser_unary_expression): Likewise.
1548 * cp-tree.h: Adjust prototype.
1550 * method.c (defaulted_late_check): Give the defaulted method
1551 the same exception specification as the implicit declaration.
1553 2010-06-15 Jason Merrill <jason@redhat.com>
1555 * class.c (add_implicitly_declared_members): Implicit assignment
1556 operators can also be virtual overriders.
1557 * method.c (lazily_declare_fn): Likewise.
1559 * call.c (convert_like_real): Give "initializing argument of"
1560 information for ambiguous conversion. Give source position
1563 * call.c (print_z_candidates): Do print viable deleted candidates.
1564 (joust): Don't choose a deleted function just because its worst
1565 conversion is better than another candidate's worst.
1567 * call.c (convert_like_real): Don't complain about
1568 list-value-initialization from an explicit constructor.
1570 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1571 DECL_SOURCE_LOCATION directly.
1573 * class.c (type_has_user_provided_default_constructor): Use
1576 * call.c (is_subseq): Handle ck_aggr, ck_list.
1577 (compare_ics): Treat an aggregate or ambiguous conversion to the
1578 same type as involving the same function.
1580 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1582 * typeck.c (convert_for_assignment): Fix comment. Change message
1583 format from %d to %qP.
1584 (convert_for_initialization): Fix comment.
1586 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1588 * cp-tree.h (expr_list_kind): New type.
1589 (impl_conv_rhs): New type.
1590 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1592 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1593 diagnostics for easy translation. Change caller.
1594 (convert_for_initialization): Use impl_conv_rhs and change caller.
1595 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1596 diagnostics for easy translation. Change caller.
1597 * decl.c (bad_spec_place): New enum.
1598 (bad_specifiers): Use it and emit the diagnostics for easy
1599 translation. Change caller.
1600 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1602 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1604 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1606 * decl2.c (cp_write_global_declarations): Adjust for new type of
1607 decl_namespace_list.
1608 * name-lookup.c (current_decl_namespace): Likewise.
1609 (push_decl_namespace): Likewise.
1610 (pop_decl_namespace): Likewise.
1612 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1614 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1615 instead of build_function_type.
1616 * decl.c (cxx_init_decl_processing): Likewise.
1617 (declare_global_var): Likewise.
1618 (get_atexit_node): Likewise.
1619 (expand_static_init): Likewise.
1620 * decl2.c (start_objects): Likewise.
1621 (start_static_storage_duration_function): Likewise.
1622 * except.c (init_exception_processing): Likewise.
1623 (build_exc_ptr): Likewise.
1624 (build_throw): Likewise.
1625 * rtti.c (throw_bad_cast): Likewise.
1626 (throw_bad_typeid): Likewise.
1627 (build_dynamic_cast_1): Likewise.
1629 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1631 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1632 (build_op_delete_call): Likewise.
1633 (build_over_call): Likewise.
1634 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1635 * pt.c (process_partial_specialization): Likewise.
1636 (tsubst_template_args): Likewise.
1637 * semantics.c (finish_asm_stmt): Likewise.
1639 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1641 * decl.c (record_key_method_defined): New, broken out of ...
1642 (finish_function): ... here. Call it.
1643 (start_decl): Treat aliases as definitions.
1645 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1647 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1649 * pt.c (maybe_process_partial_specialization): Likewise.
1650 (register_specialization): Likewise.
1651 (add_pending_template): Likewise.
1652 (lookup_template_class): Likewise.
1653 (push_tinst_level): Likewise.
1655 * parser.c (cp_lexer_new_main): Likewise.
1656 (cp_lexer_new_from_tokens): Likewise.
1657 (cp_token_cache_new): Likewise.
1658 (cp_parser_context_new): Likewise.
1659 (cp_parser_new): Likewise.
1660 (cp_parser_nested_name_specifier_opt): Likewise.
1661 (cp_parser_template_id): Likewise.
1663 * name-lookup.c (binding_entry_make): Likewise.
1664 (binding_table_construct): Likewise.
1665 (binding_table_new): Likewise.
1666 (cxx_binding_make): Likewise.
1667 (pushdecl_maybe_friend): Likewise.
1668 (begin_scope): Likewise.
1669 (push_to_top_level): Likewise.
1671 * lex.c (init_reswords): Likewise.
1672 (retrofit_lang_decl): Likewise.
1673 (cxx_dup_lang_specific_decl): Likewise.
1674 (copy_lang_type): Likewise.
1675 (cxx_make_type): Likewise.
1677 * decl.c (make_label_decl): Likewise.
1678 (check_goto): Likewise.
1679 (start_preparsed_function): Likewise.
1680 (save_function_data): Likewise.
1682 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1684 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1686 * class.c (finish_struct_1): Likewise.
1688 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1689 (struct lang_decl): Likewise.
1691 * parser.c (cp_parser_new): Update comment to not reference
1694 2010-06-07 Jason Merrill <jason@redhat.com>
1697 * error.c (dump_parameters): Mask out TFF_SCOPE.
1698 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1699 (dump_scope): Remove no-op mask.
1702 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1704 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1705 * init.c (build_offset_ref): Use it.
1706 * pt.c (maybe_process_partial_specialization): Use it.
1707 (instantiate_class_template): Use it.
1708 * search.c (lookup_base): Use it.
1710 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1713 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1714 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1715 handled_component_p.
1718 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1719 set also DECL_READ_P on the decl.
1721 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1724 * cp-tree.h (typedef_variant_p): Move this declaration to
1726 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1727 * decl.c (grokdeclarator): Do not rename debug info of an
1728 anonymous tagged type named by a typedef.
1730 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1733 * class.c (check_field_decls): Move the call to
1734 check_bitfield_decl before trying to set the
1735 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1737 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1739 * typeck.c: Update include path for moved files.
1742 * cp-gimplify.c: Likewise.
1743 * cp-lang.c: Likewise.
1745 * semantics.c: Likewise.
1746 * cxx-pretty-print.h: Likewise.
1747 * decl2.c: Likewise.
1748 * parser.c: Likewise.
1749 * cp-objcp-common.c: Likewise.
1750 * cp-tree.h: Likewise.
1751 * name-lookup.c: Likewise.
1753 * name-lookup.h: Likewise.
1754 * config-lang.in: Update paths in gtfiles for files in c-family/.
1755 * Make-lang.in: Likewise.
1757 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1759 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1760 * typeck.c (build_ptrmemfunc): Likewise.
1762 2010-06-04 Jason Merrill <jason@redhat.com>
1764 * typeck2.c (merge_exception_specifiers): Adjust merging of
1765 throw() and noexcept(true).
1767 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1768 using an uninitialized variable.
1770 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1771 (pp_cxx_expression): Likewise.
1773 Implement noexcept-specification (15.4)
1774 * parser.c (cp_parser_exception_specification_opt): Parse it.
1775 Give -Wdeprecated warning about throw() specs.
1776 * pt.c (tsubst_exception_specification): Handle it.
1777 * error.c (dump_exception_spec): Handle it.
1778 (dump_expr): Handle NOEXCEPT_EXPR.
1779 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1780 * typeck.c (comp_except_specs): Handle compatibility rules.
1781 Change exact parm to take an enum.
1782 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1783 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1784 (type_throw_all_p, build_noexcept_spec): New fns.
1785 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1786 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1787 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1788 (noexcept_true_spec, noexcept_false_spec): New macros.
1789 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1790 * search.c (check_final_overrider): Adjust.
1791 * decl.c (check_redeclaration_exception_specification): Adjust.
1792 (use_eh_spec_block): Use type_throw_all_p.
1793 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1794 Give operator new a noexcept-specification in C++0x mode.
1795 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1796 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1798 Implement noexcept operator (5.3.7)
1799 * cp-tree.def (NOEXCEPT_EXPR): New.
1800 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1801 * cp-tree.h: Declare finish_noexcept_expr.
1802 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1803 * pt.c (tsubst_copy_and_build): And tsubst it.
1804 (type_dependent_expression_p): Handle it.
1805 (value_dependent_expression_p): Handle it.
1807 * call.c (build_conditional_expr): Never fold in unevaluated context.
1808 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1809 * semantics.c (simplify_aggr_init_expr): Likewise.
1810 * typeck.c (merge_types): Call merge_exception_specifiers.
1811 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1812 DECL_ANTICIPATED for preferring new type.
1814 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1816 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1819 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1822 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1823 on object for static data members.
1825 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1826 Jason Merrill <jason@redhat.com>
1829 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1830 with the same type, call mark_lvalue_use on both.
1832 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1834 * class.c (struct vtbl_init_data_s): Remove last_init field.
1835 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1837 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1839 (build_vtt): Likewise.
1840 (initialize_vtable): Take a VEC instead of a tree.
1841 (build_vtt_inits): Change return type to void. Take a VEC **
1842 instead of a tree *; accumulate results into said VEC.
1843 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1844 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1845 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1847 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1848 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1850 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1851 rather than tree_cons.
1852 (build_vbase_offset_vtbl_entries): Likewise.
1853 (add_vcall_offset): Likewise.
1854 (build_rtti_vtbl_entries): Likewise.
1855 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1856 * decl.c (initialize_artificial_var): Use build_constructor instead
1857 of build_constructor_from_list.
1859 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1862 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1865 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1867 * parser.c (cp_parser_mem_initializer_list): Change error text.
1869 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1871 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1872 tree_decl_map hashtab from tree_map.
1873 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1874 (init_shadowed_var_for_decl): Adjust initialization.
1877 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1878 instead of calling mark_exp_read only when not an assignment.
1881 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1882 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1883 Set DECL_VALUE_EXPR on var.
1885 2010-06-02 Jason Merrill <jason@redhat.com>
1887 * error.c (dump_type): Improve typedef handling.
1892 * name-lookup.c (same_entity_p): New.
1893 (ambiguous_decl): Multiple declarations of the same entity
1896 2010-06-01 Jason Merrill <jason@redhat.com>
1899 * call.c (add_list_candidates): Prefer the default constructor.
1900 (build_aggr_conv): Treat missing initializers like { }.
1901 * typeck2.c (process_init_constructor_record): Likewise.
1902 * init.c (expand_default_init): Use digest_init for
1903 direct aggregate initialization, too.
1905 * call.c (add_list_candidates): Split out...
1906 (build_user_type_conversion_1): ...from here.
1907 (build_new_method_call): And here.
1908 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1911 * call.c (build_list_conv): Set list-initialization flags properly.
1913 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
1915 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1917 2010-06-01 Arnaud Charlet <charlet@adacore.com>
1918 Matthew Gingell <gingell@adacore.com>
1920 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1921 * decl2.c: Include langhooks.h and c-ada-spec.h.
1922 (cpp_check, collect_source_refs, collect_ada_namespace,
1923 collect_all_refs): New functions.
1924 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1925 * lang-specs.h: Ditto.
1927 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1929 * cp-tree.h (cp_build_function_call_nary): Declare.
1930 * typeck.c (cp_build_function_call_nary): Define.
1931 * decl.c (register_dtor_fn): Use it instead of
1932 cp_build_function_call.
1933 (cxx_maybe_build_cleanup): Likewise.
1934 * decl2.c (generate_ctor_or_dtor_function): Likewise.
1935 * except.c (do_get_exception_ptr): Likewise.
1936 (do_begin_catch): Likewise.
1937 (do_allocate_exception): Likewise.
1938 (do_free_exception): Likewise.
1939 (build_throw): Likewise. Use cp_build_function_call_vec instead
1940 of cp_build_function_call.
1941 (do_end_catch): Likewise.
1943 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1945 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
1946 (struct cp_declarator): Move id_loc field up.
1948 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1950 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
1951 this file is included before c-common.h. Define GCC_DIAG_STYLE
1952 before including diagnostic-core.h and toplev.h.
1953 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
1954 * pt.c: Include cp-tree.h before c-common.h.
1956 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1958 * tree.c (c_register_addr_space): Add stub.
1960 2010-05-28 Joseph Myers <joseph@codesourcery.com>
1962 * g++spec.c (lang_specific_driver): Use fatal_error instead of
1965 2010-05-28 Dodji Seketeli <dodji@redhat.com>
1967 Revert fix of PR c++/44188
1968 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
1970 * tree.c (typedef_variant_p): Revert moving this definition to
1972 * decl.c (grokdeclarator): Revert naming typedef handling.
1974 2010-05-27 Joseph Myers <joseph@codesourcery.com>
1976 * call.c: Include diagnostic-core.h instead of diagnostic.h.
1977 * cp-lang.c: Don't include diagnostic.h
1978 * name-lookup.c: Include diagnostic-core.h instead of
1980 (cp_emit_debug_info_for_using): Use seen_error.
1981 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
1982 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
1983 * pt.c (iterative_hash_template_arg): Use seen_error.
1984 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
1985 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
1986 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
1987 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
1990 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1993 * cp-tree.h (typedef_variant_p): Move this declaration to
1995 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1996 * decl.c (grokdeclarator): Do not rename debug info of an
1997 anonymous tagged type named by a typedef.
1999 2010-05-27 Jason Merrill <jason@redhat.com>
2002 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
2005 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
2008 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
2009 * class.c (layout_class_type): Likewise.
2010 * decl.c (finish_enum): Likewise.
2011 * mangle.c (write_builitin_type): Likewise.
2013 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
2015 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
2017 * decl.c (grokdeclarator): Handle __int128.
2018 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
2019 (cp_parser_simple_type_specifier): Likewise.
2020 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
2021 * typeck.c (cp_common_type): Handle __int128.
2022 * mangle.c (integer_type_codes): Add itk_int128 and
2023 itk_unsigned_int128.
2025 2010-05-26 Jason Merrill <jason@redhat.com>
2028 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2031 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2033 * cp-lang.c: Do not include expr.h.
2035 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2037 * decl.c: Do not include rtl.h
2038 * semantics.c: Likewise.
2040 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2042 * cp-tree.h: Do not include splay-tree.h.
2043 (struct prtmem_cst): Remove unused field and false comment.
2044 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2045 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2046 * init.c: Do not include rtl.h and expr.h.
2047 * class.c: Do not include rtl.h. Include splay-tree.h.
2048 (build_clone): Use plain NULL instead of NULL_RTX.
2049 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2050 included. Include splay-tree.h.
2051 * method.c: Do not include rtl.h and expr.h.
2052 (use_thunk): Use plain NULL instead of NULL_RTX.
2053 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2054 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2055 and target.h. Include splay-tree.h.
2056 * expr.c: Do not include rtl.h and expr.h.
2057 * pt.c: Do not include obstack.h and rtl.h.
2058 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2059 (tsubst_decl): Likewise.
2060 (instantiate_decl): Likewise.
2061 * semantics.c: Do not include exprt.h and debug.h. Explain why
2062 rtl.h has to be included.
2063 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2064 * call.c: Do not include rtl.h and expr.h.
2065 * search.c: Do not include obstack.h and rtl.h.
2066 * friend.c: Do not include rtl.h and expr.h.
2067 * Make-lang.in: Update dependencies.
2069 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2072 * parser.c (non_integral_constant): Add NIC_NONE.
2073 (required_token): Add RT_NONE.
2074 (cp_parser_unary_expression): Initialize non_constant_p
2076 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2077 (cp_parser_primary_expression, cp_parser_postfix_expression,
2078 cp_parser_cast_expression, cp_parser_binary_expression,
2079 cp_parser_functional_cast): Fix formatting.
2081 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2084 * parser.c: Remove inclusion of dyn-string.h.
2085 (non_integral_constant): New enum.
2086 (name_lookup_error): New enum.
2087 (required_token): New enum.
2088 (cp_parser_required_error): New function.
2089 (cp_parser_require): Change the type of variable token_desc to
2090 required_token and use cp_parser_required_error.
2091 (cp_parser_require_keyword): Likewise.
2092 (cp_parser_error): Use gmsgid as parameter.
2093 (cp_parser_name_lookup_error): Change the type of variable desired to
2094 name_lookup_error and put the diagnostic in the full sentences. Change
2096 (cp_parser_non_integral_constant_expression): Change the type of the
2097 variable thing to non_integral_constant and put the diagnostics in
2098 full sentences. Change caller.
2100 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2103 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2105 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2107 * error.c (cp_diagnostic_starter): Update call to
2108 diagnostic_build_prefix.
2109 (cp_print_error_function,
2110 print_instantiation_partial_context_line): Check show_column flag
2113 2010-05-24 Jason Merrill <jason@redhat.com>
2116 * decl.c (check_initializer): Don't wrap an init-list in a
2118 * init.c (build_aggr_init): Don't assume copy-initialization if
2119 init has CONSTRUCTOR_IS_DIRECT_INIT.
2120 * call.c (build_new_method_call): Sanity check.
2122 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2124 * rtti.c (tinfo_base_init): Use build_constructor instead of
2125 build_constructor_from_list. Don't cons a tree node for
2127 (generic_initializer): Use build_constructor_single instead of
2128 build_constructor_from_list.
2129 (ptr_initializer): Use build_constructor instead of
2130 build_constructor_from_list
2131 (ptm_initializer): Likewise.
2132 (class_initializer): Likewise. Take varargs instead of TRAIL.
2133 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2134 build_constructor instead of build_constructor_from_list.
2136 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2138 * semantics.c: Include bitmap.h.
2139 * Make-lang.in: Update dependencies.
2141 2010-05-22 Jan Hubicka <jh@suse.cz>
2143 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2145 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2147 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2149 * cxx-pretty-print.c: Correct merge error.
2151 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2153 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2154 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2155 (cp_printer): Handle %K here using percent_K_format.
2156 * cxx-pretty-print.c: Include tree-pretty-print.h.
2157 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2160 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2162 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2163 Clean up redundant includes.
2165 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2168 * decl.c (xref_basetypes): Return false in case of ill-formed
2171 2010-05-19 Jason Merrill <jason@redhat.com>
2173 * call.c (reference_binding): Use cp_build_qualified_type_real
2174 and cp_type_quals consistently.
2175 (add_function_candidate): Likewise.
2176 (build_conditional_expr): Likewise.
2177 (convert_like_real): Likewise.
2178 (type_passed_as): Likewise.
2179 * class.c (add_method): Likewise.
2180 (same_signature_p): Likewise.
2181 (layout_class_type): Likewise.
2182 * decl.c (cxx_init_decl_processing): Likewise.
2183 (cp_fname_init): Likewise.
2184 (grokdeclarator): Likewise.
2185 * decl2.c (cp_reconstruct_complex_type): Likewise.
2186 * init.c (build_new_1): Likewise.
2187 * method.c (do_build_copy_constructor): Likewise.
2188 (implicitly_declare_fn): Likewise.
2189 * pt.c (tsubst_aggr_type): Likewise.
2191 * rtti.c (init_rtti_processing): Likewise.
2192 (build_headof): Likewise.
2193 (build_dynamic_cast_1): Likewise.
2194 (tinfo_base_init): Likewise.
2195 (emit_support_tinfos): Likewise.
2196 * semantics.c (capture_decltype): Likewise.
2197 * tree.c (cv_unqualified): Likewise.
2198 * typeck.c (composite_pointer_type): Likewise.
2199 (string_conv_p): Likewise.
2201 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2203 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2204 * decl.c (start_decl): Likewise.
2205 * semantics.c (finish_compound_literal): Likewise.
2206 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2207 (cp_type_readonly): Remove.
2208 * cp-tree.h: Remove declaration.
2210 * typeck.c (merge_types): Preserve memfn quals.
2212 * decl.c (grokdeclarator): Don't check quals on fn type.
2213 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2214 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2217 * typeck.c (type_memfn_quals): New fn.
2218 (apply_memfn_quals): New fn.
2219 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2220 (cp_type_readonly): Use cp_type_quals.
2221 * cp-tree.h: Add declarations.
2222 * tree.c (cp_build_qualified_type_real): Don't set, but do
2223 preserve, quals on FUNCTION_TYPE.
2224 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2225 * decl.c (build_ptrmem_type): Likewise.
2226 (grokdeclarator): Likewise.
2227 (static_fn_type): Likewise.
2228 * decl2.c (change_return_type): Likewise.
2229 (cp_reconstruct_complex_type): Likewise.
2230 * pt.c (tsubst_function_type): Likewise.
2232 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2234 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2236 * tree.c (build_min_non_dep_call_vec): Update comment.
2238 2010-05-17 Jason Merrill <jason@redhat.com>
2240 * call.c (struct z_candidate): Add explicit_targs field.
2241 (add_template_candidate_real): Set it.
2242 (build_over_call): Use it to control init-list warning.
2245 * call.c (build_over_call): Limit init-list deduction warning to
2246 cases where the argument is actually an init-list.
2249 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2251 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2252 Jason Merrill <jason@redhat.com>
2255 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2257 2010-05-15 Jason Merrill <jason@redhat.com>
2259 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2260 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2262 (finish_eh_spec_block): Adjust.
2264 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2267 * pt.c (tsubst): Unshare template argument.
2269 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2271 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2272 * Make-lang.in: Fix dependencies accordingly.
2274 2010-05-14 Jason Merrill <jason@redhat.com>
2277 * except.c (build_throw): Simplify, adjust for DR 475.
2280 * except.c (dtor_nothrow): Return nonzero for type with
2284 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2285 gimple_build_eh_must_not_throw.
2287 2010-05-14 Martin Jambor <mjambor@suse.cz>
2289 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2292 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2294 * call.c (build_new_method_call): Change warning text.
2295 * typeck2.c (build_functional_cast): Change error text.
2297 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2300 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2301 shadowing the outer parameter or variables by the declaration of
2302 nested function in nested structure or class. Warn the shadowing by
2303 the declaration of nested lambda expression.
2305 2010-05-13 Jason Merrill <jason@redhat.com>
2307 * typeck.c (cp_build_array_ref): Factor out from...
2308 (build_array_ref): ...here. Drop complain parm.
2309 (build_new_op): Adjust.
2310 * class.c (build_vtbl_ref_1): Adjust.
2311 * decl2.c (grok_array_decl): Adjust.
2312 * cp-tree.h: Adjust prototypes.
2314 2010-05-13 Jan Hubicka <jh@suse.cz>
2316 * decl.c (cp_finish_decl): Do not worry about used attribute.
2318 2010-05-12 Jason Merrill <jason@redhat.com>
2320 * typeck.c (build_array_ref): Take complain parm.
2321 * cp-tree.h: Add it to prototype.
2322 * call.c (build_new_op): Pass it.
2323 * class.c (build_vtbl_ref): Pass it.
2324 * decl2.c (grok_array_decl): Pass it.
2328 * cp-tree.def (NULLPTR_TYPE): Remove.
2329 * cp-tree.h (NULLPTR_TYPE_P): New.
2330 (SCALAR_TYPE_P): Use it.
2331 (nullptr_type_node): New.
2332 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2333 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2335 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2336 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2337 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2338 * mangle.c (write_type): Likewise.
2339 * name-lookup.c (arg_assoc_type): Likewise.
2340 * typeck.c (build_reinterpret_cast_1): Likewise.
2341 * rtti.c (typeinfo_in_lib_p): Likewise.
2342 (emit_support_tinfos): Remove local nullptr_type_node.
2344 * cp-tree.h (UNKNOWN_TYPE): Remove.
2345 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2346 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2347 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2348 * class.c (instantiate_type): Check unknown_type_node rather than
2350 * name-lookup.c (maybe_push_decl): Likewise.
2351 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2352 (get_typeid): Likewise.
2353 * semantics.c (finish_offsetof): Likewise.
2356 * call.c (add_template_candidate_real): If deduction fails, still
2357 add the template as a non-viable candidate.
2358 (equal_functions): Handle template candidates.
2359 (print_z_candidate): Likewise.
2360 (print_z_candidates): Likewise.
2361 (build_new_function_call): Likewise.
2363 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2364 * call.c (add_candidates): Enforce it.
2365 (build_new_method_call): Try non-list ctor if no viable list ctor.
2366 (build_user_type_conversion_1): Likewise.
2368 * call.c (add_candidates): Distinguish between type(x) and
2370 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2371 (build_new_method_call): Give better error for conversion op.
2373 * call.c (add_candidates): Add first_arg and return_type parms.
2374 Add special constructor/conversion op handling.
2375 (convert_class_to_reference): Use it.
2376 (build_user_type_conversion_1): Likewise.
2377 (build_op_call): Likewise.
2378 (build_new_method_call): Likewise.
2379 (build_new_op): Adjust.
2380 (perform_overload_resolution): Adjust.
2382 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2387 * pt.c (process_partial_specialization): Return error_mark_node
2388 in case of unused template parameters in partial specialization.
2390 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2393 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2394 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2395 look at its second operand.
2397 2010-05-10 Jason Merrill <jason@redhat.com>
2400 * semantics.c (baselink_for_fns): Revert earlier change.
2403 * typeck.c (cp_build_modify_expr): Complain about assignment to
2404 array from init list.
2406 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2409 * decl.c (check_initializer): strip array type before checking for
2410 uninitialized const or ref members.
2412 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2415 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2416 error count. Emit errors only if compain is true.
2417 (build_new_1): Do not return error_mark_node if
2418 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2419 errors. Delay the check for user-provided constructor.
2420 (perform_member_init): Adjust.
2421 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2424 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2425 Jason Merrill <jason@redhat.com>
2427 Add support for C++0x nullptr.
2428 * cp-tree.def: Add NULLPTR_TYPE.
2429 * cp-tree.h: Add nullptr_node.
2430 (cp_tree_index): Add CPTI_NULLPTR.
2431 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2432 * call.c (null_ptr_cst_p): Handle nullptr.
2433 (standard_conversion): Likewise.
2434 (convert_arg_to_ellipsis): Likewise.
2435 * mangle.c (write_type): Likewise.
2436 * name-lookup.c (arg_assoc_type): Likewise.
2437 * parser.c (cp_parser_primary_expression): Likewise.
2438 * typeck.c (cp_build_binary_op): Likewise.
2439 (build_reinterpret_cast_1): Likewise.
2440 * error.c (dump_type): Likewise.
2441 (dump_type_prefix, dump_type_suffix): Likewise.
2442 * decl.c (cxx_init_decl_processing): Likewise.
2443 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2444 * cvt.c (ocp_convert): Likewise.
2445 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2446 nullptr_t tinfo in libsupc++.
2448 2010-05-06 Jason Merrill <jason@redhat.com>
2450 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2452 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2453 Dodji Seketeli <dodji@redhat.com>
2456 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2458 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2459 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2460 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2461 (cp_build_unary_op): Call lvalue_use.
2462 * decl.c (unused_but_set_errorcount): New variable.
2463 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2464 (duplicate_decls): Merge DECL_READ_P flags.
2465 (start_cleanup_fn): Set DECL_READ_P flag.
2466 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2467 * tree.c (rvalue): Call rvalue_use.
2468 * pt.c (convert_nontype_argument): Likewise.
2469 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2470 finish_decltype_type): Likewise.
2471 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2472 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2473 or rvalue_use depending on the expr.
2474 * init.c (build_new, build_delete): Likewise.
2475 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2477 2010-05-05 Jason Merrill <jason@redhat.com>
2480 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2481 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2483 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2486 * pt.c (unify): Check each elt for error_mark_node.
2488 2010-05-04 Jason Merrill <jason@redhat.com>
2491 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2493 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2496 * call.c (build_new_method_call): Return error_mark_node if fns is
2499 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2502 * pt.c (most_specialized_class): Pretend we are processing
2503 a template decl during the call to coerce_template_parms.
2505 2010-05-03 Jason Merrill <jason@redhat.com>
2509 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2510 from the selected underlying type unless -fstrict-enums. Set
2511 ENUM_UNDERLYING_TYPE to have the restricted range.
2512 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2513 * class.c (check_bitfield_decl): Likewise.
2515 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2518 * init.c (build_new_1): Revert the accidental checkin in
2521 2010-04-30 Jason Merrill <jason@redhat.com>
2524 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2525 (pp_cxx_type_specifier_seq): ...here.
2527 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2529 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2530 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2532 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2535 * typeck.c (warn_args_num): New function.
2536 (convert_arguments): Use warn_args_num to print the diagnostic
2539 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2542 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2543 user-provided constructor while recursing.
2545 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2548 * error.c (print_instantiation_partial_context_line): Handle
2549 recursive instantiation.
2550 (print_instantiation_partial_context): Likewise.
2552 2010-04-27 Jason Merrill <jason@redhat.com>
2554 * init.c (perform_member_init): Check CLASS_TYPE_P.
2556 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2559 * init.c (perform_member_init): check for uninitialized const or
2560 reference members, including array types.
2562 2010-04-24 Jason Merrill <jason@redhat.com>
2564 * tree.c (get_fns): Split out from get_first_fn.
2565 * cp-tree.h: Declare it.
2566 * search.c (shared_member_p): Use it.
2567 * semantics.c (finish_qualified_id_expr): Simplify.
2568 (finish_id_expression): Simplify.
2570 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2571 whenever object is NULL_TREE. Don't do 'this' capture here.
2572 (finish_qualified_id_expr): Pass NULL_TREE.
2573 (finish_id_expression): Likewise.
2574 (lambda_expr_this_capture): Likewise.
2576 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2577 rather than checking current_class_ref directly.
2578 (finish_call_expr): Likewise.
2581 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2582 * class.c (current_nonlambda_class_type): New fn.
2583 * semantics.c (nonlambda_method_basetype): New.
2584 * cp-tree.h: Declare them.
2585 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2587 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2590 * semantics.c (lambda_return_type): Complain about
2594 * tree.c (cv_unqualified): Handle error_mark_node.
2597 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2598 if we don't want errors.
2601 * class.c (convert_to_base): Add complain parameter. Pass
2602 ba_quiet to lookup_base if we don't want errors.
2603 (build_vfield_ref): Pass complain to convert_to_base.
2604 * call.c (convert_like_real): Likewise.
2605 (initialize_reference): Likewise.
2606 (perform_direct_initialization_if_possible): Pass complain to
2608 * cp-tree.h: Adjust.
2610 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2611 Jason Merrill <jason@redhat.com>
2614 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2616 (check_initializer): Call it for classes that need constructing, too.
2617 * class.c (in_class_defaulted_default_constructor): New.
2618 * cp-tree.h: Declare it.
2620 2010-04-20 Jason Merrill <jason@redhat.com>
2623 * init.c (constant_value_1): Treat error_mark_node as a constant
2624 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2625 * cvt.c (ocp_convert): Handle getting error_mark_node from
2626 integral_constant_value.
2627 * decl.c (compute_array_index_type): Likewise.
2629 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2633 * typeck.c (incompatible_dependent_types_p): If one of the
2634 compared types if not a typedef then honour their main variant
2637 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2639 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2641 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2644 * typeck.c (structural_comptypes): Test dependent typedefs
2645 incompatibility before testing for their main variant based
2648 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2650 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2651 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2653 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2655 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2656 build_common_tree_nodes.
2658 2010-04-14 Jason Merrill <jason@redhat.com>
2661 * parser.c (cp_parser_parenthesized_expression_list): Change
2662 is_attribute_list parm to int to indicate whether or not to
2663 handle initial identifier specially.
2664 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2666 2010-04-13 Jason Merrill <jason@redhat.com>
2668 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2670 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2671 unevaluated context.
2672 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2674 2010-04-12 Jason Merrill <jason@redhat.com>
2677 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2678 return value directly.
2680 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2682 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2685 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2686 * init.c (build_new_1): Check for uninitialized const members and
2687 uninitialized reference members, when using new without
2688 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2689 (diagnose_uninitialized_cst_or_ref_member): Define, call
2690 diagnose_uninitialized_cst_or_ref_member_1.
2691 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2693 2010-04-12 Richard Guenther <rguenther@suse.de>
2696 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2697 template inline functions.
2699 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2702 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2705 2010-04-07 Jason Merrill <jason@redhat.com>
2708 * decl.c (start_preparsed_function): Do defer nested functions.
2710 PR c++/11094, DR 408
2711 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2712 * decl2.c (finish_static_data_member_decl): Set it.
2713 * decl.c (duplicate_decls): Propagate it.
2714 * pt.c (tsubst_decl): Don't substitute the domain of an array
2715 VAR_DECL if it's set.
2716 (regenerate_decl_from_template): Substitute it here.
2717 (type_dependent_expression_p): Return true if it's set.
2718 * semantics.c (finish_decltype_type): Instantiate such a variable.
2719 * typeck.c (cxx_sizeof_expr): Likewise.
2720 (strip_array_domain): New.
2723 * name-lookup.c (current_decl_namespace): Non-static.
2724 (pop_nested_namespace): Sanity check.
2725 * cp-tree.h: Declare current_decl_namespace.
2726 * decl.c (grokvardecl): Use it instead of current_namespace.
2727 (grokfndecl): Likewise.
2730 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2733 * pt.c (print_template_statistics): New.
2734 * cp-tree.h: Declare it.
2735 * tree.c (cxx_print_statistics): Call it.
2738 * decl.c (grokvardecl): Tweak warning message.
2739 (grokfndecl): Likewise.
2741 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2744 *pt.c (tsubst_decl): Get the arguments of a specialization from
2745 the specialization template, not from the most general template.
2747 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2750 * typeck2.c (process_init_constructor_record):
2751 value-initialize members that are are not explicitely
2754 2010-04-07 Jie Zhang <jie@codesourcery.com>
2757 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2758 when all of its elements are non-constant and have been split out.
2760 2010-04-06 Taras Glek <taras@mozilla.com>
2761 Jason Merrill <jason@redhat.com>
2763 * parser.c (cp_parser_class_specifier): Set class location to that
2764 of IDENTIFIER_NODE instead of '{' when possible.
2765 * semantics.c (begin_class_definition): Do not overide locations
2766 with less precise ones.
2768 2010-04-06 Jason Merrill <jason@redhat.com>
2771 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2774 * pt.c (maybe_update_decl_type): Check the return value from
2777 2010-04-01 Jason Merrill <jason@redhat.com>
2779 * decl.c (next_initializable_field): No longer static.
2780 * cp-tree.h: Declare it.
2781 * call.c (build_aggr_conv): Fail if there are more initializers
2782 than initializable fields.
2784 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2785 instead of void_zero_node.
2787 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2790 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2791 * pt.c (end_template_parm_list): Store sibling template parms of
2792 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2793 (push_template_decl_real): Don't store the containing template decl
2794 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2795 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2796 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2799 2010-03-30 Jason Merrill <jason@redhat.com>
2802 * pt.c (push_template_decl_real): Deal better with running out of
2803 scopes before running out of template parms.
2807 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2808 function parameter context. Don't print an error if parsing
2812 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2815 2010-03-26 Jason Merrill <jason@redhat.com>
2818 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2819 c++0x mode, but not other type-names.
2821 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2824 * pt.c (add_to_template_args): Support NULL ARGS;
2825 (most_specialized_class): call coerce_template_parms on
2826 template arguments passed to get_class_bindings. Use
2827 add_to_template_args.
2828 (unify): Handle VAR_DECLs.
2830 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2832 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2834 * pt.c (get_template_parms_at_level): Adjust.
2836 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2839 * cp-tree.h (get_template_parms_at_level): Declare ...
2840 * pt.c (get_template_parms_at_level): ... new function.
2841 * typeck.c (get_template_parms_of_dependent_type): If a template
2842 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2843 current_template_parms. Use get_template_parms_at_level. Remove
2845 (incompatible_dependent_types_p): If we get empty parms from just one
2846 of the template type parms we are comparing then the template parms are
2849 2010-03-24 Jason Merrill <jason@redhat.com>
2852 * parser.c (make_declarator): Initialize id_loc.
2853 (cp_parser_lambda_declarator_opt): And set it.
2855 2010-03-23 Jason Merrill <jason@redhat.com>
2857 Make lambda conversion op and op() non-static.
2858 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2859 Also add the thunk function returned by the conversion op.
2860 Mark the conversion deleted if the op() is variadic.
2861 * decl2.c (mark_used): Give helpful message about deleted conversion.
2862 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2863 * semantics.c (finish_this_expr): Adjust.
2864 * mangle.c (write_closure_type_name): Adjust.
2865 * decl.c (grok_op_properties): Don't allow it.
2866 * call.c (build_user_type_conversion_1): No static conversion ops.
2867 (build_op_call): Or op().
2869 * decl2.c (change_return_type): Fix 'this' quals.
2871 2010-03-22 Jason Merrill <jason@redhat.com>
2874 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2877 * pt.c (contains_auto_r): New fn.
2878 (do_auto_deduction): Use it.
2879 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2881 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
2884 * decl2.c (grokfield): Handle invalid initializers for member
2887 2010-03-20 Dodji Seketeli <dodji@redhat.com>
2890 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2892 * decl2.c (vague_linkage_p): Likewise.
2894 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2897 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2898 false, in the cp_parser_expression_statement call.
2900 2010-03-05 Jason Merrill <jason@redhat.com>
2902 * mangle.c (mangle_decl): Give name collision error even without
2905 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
2907 * pt.c (process_partial_specialization): Use error_n instead of
2910 2010-03-03 Jason Merrill <jason@redhat.com>
2913 * mangle.c (mangle_decl): Handle VAR_DECL, too.
2915 2010-03-03 Jason Merrill <jason@redhat.com>
2918 * mangle.c: Include cgraph.h.
2919 (mangle_decl): If the mangled name will change in a later
2920 ABI version, make the later mangled name an alias.
2921 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2922 * Make-lang.in (mangle.o): Depend on cgraph.h.
2923 * method.c (make_alias_for): Handle VAR_DECL, too.
2924 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2925 * tree.c (no_linkage_check): Adjust.
2926 * decl.c (maybe_commonize_var): Adjust.
2927 * cp-tree.h: Adjust.
2929 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
2931 * pt.c (redeclare_class_template): Use error_n and inform_n.
2933 2010-02-27 Mark Mitchell <mark@codesourcery.com>
2936 * cp-tree.h (push_tinst_level): Declare.
2937 (pop_tinst_level): Likewise.
2938 * pt.c (push_tinst_level): Give it external linkage.
2939 (pop_tinst_level): Likewise.
2940 * mangle.c (mangle_decl_string): Set the source location to that
2941 of the decl while mangling.
2943 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
2946 * pt.c (redeclare_class_template): Return false if there are erroneous
2947 template parameters.
2949 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
2951 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
2954 2010-02-24 Jason Merrill <jason@redhat.com>
2957 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
2959 * class.c (layout_class_type): Don't give -Wabi warning for a bug
2960 in a previous ABI version.
2962 2010-02-23 Jason Merrill <jason@redhat.com>
2965 * typeck2.c (digest_init_r): Accept value init of array.
2967 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
2970 * typeck.c (convert_arguments): Update error message.
2972 2010-02-22 Mike Stump <mikestump@comcast.net>
2975 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2977 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2980 * error.c (print_instantiation_partial_context_line): New.
2981 (print_instantiation_partial_context): Print at most 12 contexts,
2982 skip the rest with a message.
2984 2010-02-21 Dodji Seketeli <dodji@redhat.com>
2987 * pt.c (lookup_template_class): Better support of specialization
2988 of member of class template implicit instantiation.
2990 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
2993 * call.c (conversion_null_warnings): Replace -Wconversion with
2995 * cvt.c (build_expr_type_conversion): Likewise.
2997 2010-02-18 Jason Merrill <jason@redhat.com>
3000 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
3003 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
3005 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
3006 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
3009 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
3013 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
3014 (maybe_update_decl_type): New fn.
3015 * parser.c (cp_parser_init_declarator): Use it.
3018 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
3020 2010-02-17 Jason Merrill <jason@redhat.com>
3023 * call.c (build_over_call): Don't create zero-sized assignments.
3024 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
3025 * cp-objcp-common.c (cp_expr_size): Remove.
3026 * cp-tree.h: Remove prototype.
3029 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3030 decl we looked up doesn't match.
3033 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3034 have an INIT_EXPR anymore.
3037 * pt.c (convert_nontype_argument): Change assert to test.
3039 2010-02-16 Jason Merrill <jason@redhat.com>
3041 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3044 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3045 VIEW_CONVERT_EXPR for conversions between structural equality types
3046 that the back end can't tell are the same.
3049 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3050 cv-quals from element here.
3051 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3053 2010-02-14 Jason Merrill <jason@redhat.com>
3056 * semantics.c (finish_compound_literal): Use
3057 cp_apply_type_quals_to_decl when creating a static variable.
3059 2010-02-12 Jason Merrill <jason@redhat.com>
3062 * name-lookup.h (current_binding_level): Check for null
3065 2010-02-12 Jason Merrill <jason@redhat.com>
3068 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3070 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3073 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3076 2010-02-10 Jason Merrill <jason@redhat.com>
3079 * semantics.c (outer_lambda_capture_p): Revert.
3080 (add_capture): Only finish_member_declaration if
3081 we're in the lambda class.
3082 (register_capture_members): New.
3083 * cp-tree.h: Declare it.
3084 * parser.c (cp_parser_lambda_expression): Call it.
3086 2010-02-10 Jason Merrill <jason@redhat.com>
3089 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3090 instead of current_class_type.
3092 2010-02-10 Jason Merrill <jason@redhat.com>
3094 PR c++/42983, core issue 906
3095 * method.c (defaultable_fn_check): Check virtualness.
3097 2010-02-10 Jason Merrill <jason@redhat.com>
3100 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3102 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3104 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3105 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3107 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3108 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3109 (cp_parser_parameter_declaration)
3110 (cp_parser_exception_specification_opt)
3111 (cp_parser_exception_declaration): Likewise.
3112 * pt.c (check_default_tmpl_args): Likewise.
3113 * search.c (lookup_field_r): Likewise.
3115 2010-02-09 Jason Merrill <jason@redhat.com>
3118 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3120 2010-02-09 Jason Merrill <jason@redhat.com>
3123 * decl2.c (change_return_type): New fn.
3124 * semantics.c (apply_lambda_return_type): Use it.
3125 * cp-tree.h: Declare it.
3127 2010-02-05 Richard Guenther <rguenther@suse.de>
3129 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3130 * cp-lang.c: Include gt-cp-cp-lang.h.
3131 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3133 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3136 * typeck.c (get_template_parms_of_dependent_type): Try getting
3137 the template parameters fromt the type itself first.
3139 2010-02-03 Jason Merrill <jason@redhat.com>
3143 * mangle.c (write_unqualified_id): Split out from write_expression.
3144 (write_unqualified_name): Call it.
3145 (write_member_name): Likewise.
3146 (write_expression): Support TEMPLATE_ID_EXPR.
3147 Disambiguate operator names.
3150 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3153 2010-02-02 Jason Merrill <jason@redhat.com>
3156 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3157 * optimize.c (clone_body): Remap their initializers when making base
3159 (maybe_clone_body): Complain if multiple clones aren't safe.
3161 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3168 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3169 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3170 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3171 * pt.c (coerce_template_parms, type_unification_real,
3172 expand_template_argument_pack, coerce_template_parameter_pack):
3173 Set the non default template args count.
3174 (current_template_args): Always set non defaulted
3175 template args count when compiled with --enable-checking
3176 (tsubst_template_args, type_unification_real): Propagate the non
3177 defaulted template args count.
3178 * error.c (get_non_default_template_args_count): Renamed
3179 count_non_default_template_args into this. Don't calculate the
3180 non default template argument count anymore. Use the new
3181 accessor macros above to get it.
3182 (dump_template_argument_list, dump_type, dump_decl,
3183 dump_template_parms): Adjust.
3184 * parser.c (cp_parser_template_argument_list): Always set defaulted
3185 template args count when compiled with --enable-checking.
3187 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3189 * decl.c (redeclaration_error_message): Wrap the return messages into
3190 G_() for easy translation.
3192 2010-01-28 Jason Merrill <jason@redhat.com>
3195 * semantics.c (begin_class_definition): Don't use type_as_string.
3197 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3201 * typeck.c (get_template_parms_of_dependent_type): Factorized
3202 this out of incompatible_template_type_parms_p
3203 (incompatible_dependent_types_p): Renamed
3204 incompatible_template_type_parms_p into this. Make it detect
3205 two incompatible dependent typedefs too.
3206 (structural_comptypes): Use incompatible_dependent_types_p.
3207 * pt.c (get_template_info):
3208 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3210 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3211 Jason Merrill <jason@redhat.com>
3213 * mangle.c (write_type): Mangle transparent record as member type.
3214 * semantics.c (begin_class_definition): Recognize decimal classes
3215 and set TYPE_TRANSPARENT_AGGR.
3217 2010-01-20 Jason Merrill <jason@redhat.com>
3220 * mangle.c (write_expression): Handle tree codes that have extra
3221 arguments in the middle-end.
3223 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3226 * except.c (expand_start_catch_block): Deal correctly with
3227 do_begin_catch returning error_mark_node.
3229 2010-01-20 Jason Merrill <jason@redhat.com>
3232 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3236 * semantics.c (build_lambda_object): Call mark_used on captured
3240 * decl.c (grokdeclarator): Clear type_quals for a member function
3241 declared using a typedef. Don't complain about adding cv-quals
3242 to a function typedef in C++0x mode.
3244 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3246 * decl.c (create_array_type_for_decl): Remove set but not used
3247 variable error_msg. Remove break stmts after return stmts.
3249 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3251 * error.c (dump_template_parms, count_non_default_template_args):
3252 Revert fix of PR c++/42634.
3254 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3257 * error.c (dump_template_parms): Use innermost template
3258 arguments before calling count_non_default_template_args.
3259 (count_non_default_template_args): We are being called with
3260 template innermost arguments now. There is no need to ensure
3263 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3266 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3268 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3271 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3273 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3276 *pt.c (tsubst_decl): Get the arguments of a specialization from
3277 the specialization template, not from the most general template.
3279 2010-01-16 Jason Merrill <jason@redhat.com>
3282 * semantics.c (finish_decltype_type): Within a template, treat
3283 unresolved CALL_EXPR as dependent.
3285 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3287 * error.c (dump_template_parms,count_non_default_template_args):
3288 Revert changes of PR c++/42634.
3290 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3293 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3294 functions with noreturn attribute.
3296 2010-01-14 Jason Merrill <jason@redhat.com>
3299 * call.c (build_new_method_call): Don't free the vec here.
3302 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3304 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3307 * error.c (dump_template_parms): Use innermost template
3308 arguments before calling count_non_default_template_args.
3309 (count_non_default_template_args): We are being called with
3310 template innermost arguments now. There is no need to ensure
3313 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3316 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3317 arguments that were previously deduced.
3319 2010-01-05 Jason Merrill <jason@redhat.com>
3321 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3322 * call.c (build_over_call): Don't complain about it.
3324 2010-01-04 Jason Merrill <jason@redhat.com>
3327 * pt.c (tsubst_decl): Don't apply type attributes in place.
3330 * semantics.c (describable_type): Remove decltype comment and
3335 Copyright (C) 2010 Free Software Foundation, Inc.
3337 Copying and distribution of this file, with or without modification,
3338 are permitted in any medium without royalty provided the copyright
3339 notice and this notice are preserved.