1 2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
2 Jason Merrill <jason@redhat.com>
4 * cp-tree.h (register_constexpr_fundef): Declare.
5 * decl.c (maybe_save_function_definition): New.
6 (finish_function): Use it.
7 * semantics.c (constexpr_fundef): New datatype.
8 (constexpr_fundef_table): New global table.
9 (constexpr_fundef_equal): New.
10 (constexpr_fundef_hash): Likewise.
11 (retrieve_constexpr_fundef): Likewise.
12 (validate_constexpr_fundecl): Store in the table.
13 (build_data_member_initialization): New fn.
14 (build_constexpr_constructor_member_initializers): New.
15 (register_constexpr_fundef): Define.
16 (is_this_parameter): New.
17 (get_function_named_in_call): Likewise.
18 (get_nth_callarg): Likewise.
19 (check_automatic_or_tls): New.
20 (morally_constexpr_builtin_function_p): New.
21 (potential_constant_expression): New.
23 2010-11-01 Jason Merrill <jason@redhat.com>
25 * decl2.c (decl_constant_var_p): New fn.
26 (decl_maybe_constant_var_p): New fn.
27 (mark_used): Rework instantiation of things needed for constant
29 * cp-tree.h: Declare new fns.
30 * pt.c (instantiate_decl): Handle cp_unevaluated_operand.
31 (always_instantiate_p): Use decl_maybe_constant_var_p.
32 (instantiate_decl): Don't defer constexpr functions.
33 * repo.c (repo_emit_p): Use decl_maybe_constant_var_p.
34 * semantics.c (finish_id_expression): Use decl_constant_var_p.
35 Check for valid name in constant expr after mark_used.
37 2010-10-31 Jason Merrill <jason@redhat.com>
39 * class.c (is_really_empty_class): Work when type is not complete.
40 (synthesized_default_constructor_is_constexpr): New.
41 (add_implicitly_declared_members): Use it.
42 (type_has_constexpr_default_constructor): Likewise.
43 * cp-tree.h: Declare it.
44 * method.c (synthesized_method_walk): Use it.
46 * decl.c (pop_switch): Use EXPR_LOC_OR_HERE.
47 * typeck.c (convert_for_assignment): Likewise.
49 * parser.c (cp_parser_diagnose_invalid_type_name): Give helpful
50 message about constexpr without -std=c++0x.
52 * decl.c (grokdeclarator): Don't ICE on constexpr non-static data
55 2010-10-30 Nathan Froyd <froydnj@codesourcery.com>
57 * class.c (layout_vtable_decl): Call build_array_of_n_type.
58 (build_vtt, build_ctor_vtabl_group): Likewise.
60 2010-10-30 Nicola Pero <nicola.pero@meta-innovation.com>
62 Implemented Objective-C 2.0 @property, @synthesize and @dynamic.
63 * parser.c (cp_parser_objc_at_property_declaration): Removed
64 parsing of RID_COPIES and RID_IVAR. Updated call to
65 objc_add_property_declaration.
66 * typecheck.c (finish_class_member_access_expr): Call
67 objc_maybe_build_component_ref instead of objc_build_setter_call.
68 (cp_build_modify_expr): Call objc_maybe_build_modify_expr instead
69 of objc_build_getter_call.
71 2010-10-27 Jason Merrill <jason@redhat.com>
73 * cp-tree.h (cp_trait_kind): Add CPTK_IS_LITERAL_TYPE.
74 * cxx-pretty-print.c (pp_cxx_trait_expression): Handle it.
75 * semantics.c (trait_expr_value, finish_trait_expr): Likewise.
76 * parser.c (cp_parser_primary_expression): Handle RID_IS_LITERAL_TYPE.
77 (cp_parser_trait_expr): Likewise.
79 2010-10-27 Gabriel Dos Reis <gdr@cse.tamu.edu>
80 Jason Merrill <jason@redhat.com>
82 * decl.c (finish_case_label): Use decl_constant_value.
84 * method.c (synthesized_method_walk): Track constexprness too.
85 (process_subob_fn, walk_field_subobs): Likewise.
86 (implicitly_declare_fn): Set DECL_DECLARED_CONSTEXPR_P.
87 (defaulted_late_check): Handle DECL_DECLARED_CONSTEXPR_P.
88 * class.c (add_implicitly_declared_members): Handle
89 constexpr default ctor.
91 * parser.c (cp_parser_ctor_initializer_opt_and_function_body):
92 Make sure a constexpr ctor has an empty body.
93 * class.c (type_has_constexpr_default_constructor): New.
94 * cp-tree.h: Declare it.
95 * init.c (perform_member_init): Complain about uninitialized
96 member in constexpr ctor.
97 (emit_mem_initializers): And uninitialized base.
98 * decl.c (check_tag_decl): Fix typo.
100 * semantics.c (valid_type_in_constexpr_fundecl_p): New fn.
101 (is_valid_constexpr_fn): New fn.
102 (validate_constexpr_fundecl): Use it.
103 * decl.c (validate_constexpr_redeclaration): New.
104 (duplicate_decls): Use it.
105 (cp_finish_decl): Call validate_constexpr_fundecl and
106 ensure_literal_type_for_constexpr_object here.
107 (start_decl): Not here. Don't ICE on constexpr reference.
108 (check_for_uninitialized_const_var): Don't handle constexpr specially.
109 (grokfndecl): Set DECL_DECLARED_CONSTEXPR_P.
110 (check_static_variable_definition): Give friendly message about
112 (grokdeclarator): Complain about typedef and volatile with constexpr.
113 Reorganize. Give sorry about non-static data members in C++0x mode.
114 (start_preparsed_function): Check validate_constexpr_fundecl here.
115 (check_function_type): Not here.
116 * decl2.c (finish_static_data_member_decl): Don't complain about
118 * parser.c (CP_PARSER_FLAGS_ONLY_TYPE_OR_CONSTEXPR): New.
119 (cp_parser_condition): Pass it to cp_parser_decl_specifier_seq.
120 (cp_parser_decl_specifier_seq): Handle it.
121 (cp_parser_explicit_instantiation): Diagnose inline and constexpr.
123 * class.c (check_bases): Propagate non-literality.
124 (check_field_decls): Likewise.
125 (finalize_literal_type_property): New.
126 (check_bases_and_members): Call it.
127 * cp-tree.h (TYPE_HAS_CONSTEXPR_CTOR): New.
128 (lang_type_class): Add has_constexpr_ctor field.
129 (DECL_DECLARED_CONSTEXPR_P): Strip template.
130 * decl.c (grok_special_member_properties): Set
131 TYPE_HAS_CONSTEXPR_CTOR.
133 2010-10-27 Jason Merrill <jason@redhat.com>
135 * call.c (build_integral_nontype_arg_conv): New.
136 * cp-tree.h: Declare it.
137 * pt.c (convert_nontype_argument): Use it.
139 * error.c (dump_simple_decl): Print constexpr.
141 * cvt.c (build_up_reference): Use target_type for the temporary var.
143 * except.c (build_throw): Set EXPR_LOCATION.
145 * tree.c (build_cplus_new): Handle CONSTRUCTOR.
147 * semantics.c (finish_compound_stmt): Avoid creating an
148 unnecessary BIND_EXPR.
150 * call.c (convert_like_real): Don't check narrowing if the element
151 is also an initializer-list.
153 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
155 * parser.c (cp_parser_objc_at_property_declaration): Recognize
156 RID_ASSIGN, RID_COPY, RID_RETAIN, RID_READWRITE and RID_NONATOMIC.
157 Do not use objc_set_property_attr, but use local variables
158 instead. Detect repeated usage of setter, getter and ivar
159 attributes. Improved error processing when a setter name does not
160 end in ':'. Do not check for CPP_CLOSE_PAREN after we determined
161 that the token is a keyword. Updated call to
162 objc_add_property_declaration.
164 2010-10-27 Nicola Pero <nicola.pero@meta-innovation.com>
166 * parser.c (cp_parser_objc_property_decl): Renamed to
167 cp_parser_objc_struct_declaration. Return the parsed trees
168 instead of calling objc_add_property_variable directly. Detect
169 missing or invalid declspecs. Implemented attributes. Do not eat
170 the ';' at the end. Exit loop whenever a non-comma is parsed, not
172 (cp_parser_objc_at_property): Renamed to
173 cp_parser_objc_at_property_declaration. Updated calls to
174 objc_add_property_variable, now objc_add_property_declaration, and
175 to cp_parser_objc_property_decl, now
176 cp_parser_objc_struct_declaration. Rewritten all code to be more
177 robust in dealing with syntax errors, and almost identical to the
178 one in c_parser_objc_at_property_declaration.
179 (cp_parser_objc_property_attrlist): Removed.
180 (cp_parser_objc_method_prototype_list): Updated call to
181 cp_parser_objc_at_property.
182 (cp_parser_objc_method_definition_list): Same change.
183 (cp_parser_objc_class_ivars): Detect a number of invalid
184 declarations of instance variables and produce errors when they
187 2010-10-26 Jason Merrill <jason@redhat.com>
189 * tree.c (build_vec_init_expr): Split out from...
190 (build_array_copy): ...here.
191 * init.c (perform_member_init): Use it.
192 * cp-tree.h: Declare it.
193 * cp-gimplify.c (cp_gimplify_init_expr): Don't gimplify the slot for
194 VEC_INIT_EXPR and AGGR_INIT_EXPR here. Drop pre/post parameters.
195 (cp_gimplify_expr): Handle array default-initialization via
198 * tree.c (stabilize_expr): Handle xvalues properly.
200 * call.c (build_over_call): Use argarray[0] for 'this' argument.
202 * decl.c (finish_function): Don't look at function_depth.
204 2010-10-25 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
206 Implement opaque-enum-specifiers for C++0x.
207 * cp-tree.h (SET_OPAQUE_ENUM_P): New.
208 (OPAQUE_ENUM_P): New.
209 (ENUM_FIXED_UNDERLYING_TYPE_P): New.
210 (start_enum): Update prototype.
211 (finish_enum_value_list): New prototype.
212 * parser.c (cp_parser_elaborated_type_specifier): Issue a pedwarn if
213 "enum class" is used in an elaborated-type-specifier.
214 (cp_parser_enum_specifier): Rewrite to parse opaque-enum-specifiers.
215 * decl.c (copy_type_enum): New.
216 (finish_enum_value_list): New, with code from finish_enum.
217 (finish_enum): A lot of code removed. Added a gcc_assert.
218 (start_enum): Add parameters enumtype and is_new.
219 Rewrite to work with opaque-enum-specifiers.
220 * pt.c (maybe_process_partial_specialization): Allow for template
221 specialization of enumerations, with a pedwarn.
222 (lookup_template_class): Update call to start_enum. Call to
224 (tsubst_enum): Call to begin_scope, finish_scope and
225 finish_enum_value_list.
227 2010-10-24 Nicola Pero <nicola.pero@meta-innovation.com>
229 Removed Objective-C++ specific replacement of cxx_printable_name.
230 * cp-objcp-common.h: Added LANG_HOOKS_DECL_PRINTABLE_NAME, set
231 to cxx_printable_name for both C++ and Objective-C++.
232 * cp-lang.h: Removed LANG_HOOKS_DECL_PRINTABLE_NAME.
234 * error.c (dump_decl): For Objective-C++, call
235 objc_maybe_printable_name here ...
236 * tree.c (cxx_printable_name_internal): ... instead of here.
238 2010-10-23 Nicola Pero <nicola.pero@meta-innovation.com>
240 * tree.c (cxx_printable_name_internal): In Objective-C++, call
241 objc_maybe_printable_name.
243 2010-10-22 Jason Merrill <jason@redhat.com>
246 * pt.c (instantiate_class_template): Don't instantiate default
250 * init.c (build_vec_init): Handle memberwise move.
252 2010-10-21 Paolo Carlini <paolo.carlini@oracle.com>
255 * call.c (add_function_candidate): Don't use TREE_VALUE on null
258 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
260 * parser.c (cp_parser_objc_method_type): Mark inline. Return a
261 bool instead of calling objc_set_method_type.
262 (cp_parser_objc_method_signature): Updated calls to
263 cp_parser_objc_method_type and to objc_build_method_signature.
264 (cp_parser_objc_method_prototype_list): Updated calls to
265 objc_add_method_declaration. Use token->type to determine if it
266 is a class method or not.
267 (cp_parser_objc_method_definition_list): Same change.
269 2010-10-20 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
272 * parser.c (cp_convert_range_for): Call cp_finish_decl
273 instead of finish_expr_stmt.
275 2010-10-20 Nicola Pero <nicola.pero@meta-innovation.com>
277 * cp-lang.c (finish_file): Removed.
278 * decl2.c (cp_write_global_declarations): Call
279 objc_write_global_declarations when compiling Objective-C++.
281 2010-10-19 Paolo Carlini <paolo.carlini@oracle.com>
284 * pt.c (add_to_template_args): Check extra_args for error_mark_node.
285 (coerce_template_parms): Likewise for args.
287 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
289 Implemented parsing @synthesize and @dynamic for Objective-C++.
290 * parser.c (cp_parser_objc_method_definition_list): Recognize
291 RID_AT_SYNTHESIZE and RID_AT_DYNAMIC.
292 (cp_parser_objc_at_dynamic_declaration): New.
293 (cp_parser_objc_at_synthesize_declaration): New.
295 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
297 * parser.c (cp_parser_objc_identifier_list): Check the return
298 value of cp_parser_identifier and react if it is error_mark_node.
300 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com>
302 Merge from apple/trunk branch on FSF servers.
304 2005-03-01 Fariborz Jahanian <fjahanian@apple.com>
307 * call.c (standard_conversion, implicit_conversion): Ignore
308 'volatile' attribute of artificially volatized type in objc when
309 evaluating various conversion weights.
311 2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
314 * typeck.c (comp_ptr_ttypes_real): Remove the hack. un-volatize the
315 artiificially 'volatized' type before doing pointer comparison.
317 2010-10-18 Jakub Jelinek <jakub@redhat.com>
320 * semantics.c (finish_goto_stmt): Call mark_rvalue_use on computed
323 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
325 Merge from apple/trunk branch on FSF servers.
327 2006-04-19 Fariborz Jahanian <fjahanian@apple.com>
330 * parser.c (cp_parser_simple_type_specifier): Don't lookup for
331 objc object types if type is scope qualified.
333 2010-10-17 Nicola Pero <nicola.pero@meta-innovation.com>
335 Merge from apple/trunk branch on FSF servers.
337 2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
340 * lex.c (unqualified_name_lookup_error): Issue diagnostic
341 for private 'ivar' access.
343 2010-10-17 Iain Sandoe <iains@gcc.gnu.org>
345 * parser.c (cp_parser_objc_visibility_spec): Update to use visibility
346 enum, and handle @package.
348 2010-10-15 Jason Merrill <jason@redhat.com>
351 * tree.c (cp_build_qualified_type_real): Don't reuse a variant
352 with a different typedef variant of the element type.
354 2010-10-14 Iain Sandoe <iains@gcc.gnu.org>
356 merge from FSF apple 'trunk' branch.
357 2006 Fariborz Jahanian <fjahanian@apple.com>
359 Radars 4436866, 4505126, 4506903, 4517826
360 * typeck.c (finish_class_member_access_expr): Handle CLASS.property
362 (cp_build_modify_expr): Likewise.
363 * parser.c (cp_parser_objc_method_prototype_list): Handle @property.
364 (cp_parser_objc_method_definition_list): Likewise.
365 (cp_parser_objc_property_decl): New.
366 (cp_parser_objc_property_attrlist): New.
367 (cp_parser_objc_at_property): New.
369 2010-10-14 Richard Guenther <rguenther@suse.de>
372 * cp-tree.h (NULLPTR_TYPE_P): Adjust.
373 * decl.c (cxx_init_decl_processing): Build a NULLPTR_TYPE node,
375 * error.c (dump_type): Handle NULLPTR_TYPE.
376 (dump_type_prefix): Likewise.
377 (dump_type_suffix): Likewise.
378 * mangle.c (write_type): Likewise.
379 * name-lookup.c (arg_assoc_type): Likewise.
380 * rtti.c (typeinfo_in_lib_p): Likewise.
381 * pt.c (tsubst): Likewise.
383 2010-10-13 Jason Merrill <jason@redhat.com>
386 * class.c (fixup_attribute_variants): New fn.
387 * cp-tree.h: Declare it.
388 * pt.c (instantiate_class_template): Call it.
389 * semantics.c (begin_class_definition): Call it.
391 2010-10-13 Richard Henderson <rth@redhat.com>
393 * cp-lang.c (cp_eh_personality): Update call to
394 build_personality_function.
395 * except.c (choose_personality_routine): Update function comment.
397 2010-10-13 Richard Guenther <rguenther@suse.de>
399 * tree.c (cp_free_lang_data): Free DECL_NAMESPACE_USERS and
400 clear DECL_CHAIN of NAMESPACE_DECLs.
402 2010-10-11 Martin Jambor <mjambor@suse.cz>
405 * cp-tree.h (current_class_ref): Check that cp_function_chain is
407 * call.c (build_cxx_call): Likewise.
409 2010-10-10 Jason Merrill <jason@redhat.com>
411 * pt.c (tsubst_default_argument): Handle DEFAULT_ARG.
412 (tsubst_default_arguments): Only do this once for cloned fns.
413 (tsubst): Use typedef_variant_p. Handle LANG_TYPE. Don't
415 (tsubst_expr): Avoid calling tsubst_expr for non-expressions.
416 (tsubst_copy_and_build): Likewise.
417 (tsubst_initializer_list): Likewise.
418 (tsubst_copy): Change default to gcc_unreachable. Handle
419 OVERLOAD and PTRMEM_CST.
421 2010-10-10 Jason Merrill <jason@redhat.com>
425 * pt.c (tsubst_copy) [INTEGER_CST]: Instantiate the type.
427 2010-10-07 Andi Kleen <ak@linux.intel.com>
429 * Make-lang.in (c++_OBJS): Remove dummy-checksum.o.
430 (cc1plus-dummy): Remove.
431 (cc1plus-checksum): Change to run checksum over object files
434 2010-10-08 Joseph Myers <joseph@codesourcery.com>
436 * cp-objcp-common.h (LANG_HOOKS_INIT_OPTIONS_STRUCT): Define.
438 2010-10-07 Nicola Pero <nicola.pero@meta-innovation.com>
440 * cp-tree.def: Changed type of AT_ENCODE_EXPR from tcc_unary to
442 * cxx-pretty-print.c (pp_cxx_unary_expression): Added case for
444 * error.c (dump_expr): Added case for AT_ENCODE_EXPR.
445 * pt.c (tsubst_copy): Added case for AT_ENCODE_EXPR.
446 (value_dependent_expression_p): Added case for AT_ENCODE_EXPR.
447 (type_dependent_expression_p): Added case for AT_ENCODE_EXPR.
448 * parser.c (cp_parser_objc_encode_expression): Updated comment.
450 2010-10-07 Nicola Pero <nicola@nicola.brainstorm.co.uk>
452 Merge from apple/trunk branch on FSF servers.
454 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
457 * parser.c (cp_parser_objc_interstitial_code): Recognize
458 and parse RID_NAMESPACE keyword.
460 2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
462 * parser.c (cp_parser_objc_method_tail_params_opt): Peek new token after
463 finding ellipsis, before checking for attributes.
465 2010-10-06 Nicola Pero <nicola.pero@meta-innovation.com>
467 Merge from apple/trunk branch on FSF servers.
468 * cp-tree.def: Added AT_ENCODE_EXPR here instead of to the no
469 longer existing gcc/c-common.def.
471 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
474 * pt.c (tsubst_copy_and_build): Instantiate @endcode(T).
475 * parser.c (cp_parser_objc_encode_expression): Build a templatized
476 parse tree for @encode(T).
478 2005-12-14 Fariborz Jahanian <fjahanian@apple.com>
481 * c-common.def: Add new expression code AT_ENCODE_EXPR.
483 2010-10-06 Eric Botcazou <ebotcazou@adacore.com>
486 * typeck.c (cp_build_addr_expr_1): Add check for incomplete types in
487 code folding offsetof-like computations.
489 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
492 * parser.c (cp_parser_objc_class_interface): If no identifier
493 follows an @interface token, stop parsing the interface after
495 (cp_parser_objc_class_implementation): If no identifier follows an
496 @implementation token, stop parsing the implementation after
499 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
502 * parser.c (cp_parser_objc_method_keyword_params): If the required
503 colon is not found while parsing parameters, stop parsing them.
505 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
508 * parser.c (cp_parser_objc_class_ivars): Do not eat the EOF or
509 @end after detecting it. Print an error if @end is found without
511 (cp_parser_objc_method_prototype_list): Do not eat the EOF after
512 detecting it. Fixed reading the next token when continuing
513 because of an error in a method signature. Print an error if EOF
514 is found without an '@end'.
515 (cp_parser_objc_method_definition_list): Same change.
517 2010-10-05 Nicola Pero <nicola.pero@meta-innovation.com>
519 Merge from apple/trunk branch on FSF servers:
521 2005-10-17 Fariborz Jahanian <fjahanian@apple.com>
524 * parser.c (cp_parser_objc_method_keyword_params): Check for valid
525 method parameters and issue error.
526 (cp_parser_objc_method_definition_list): Check for invalid tokens
527 which cannot start a function definition.
529 2005-10-14 Fariborz Jahanian <fjahanian@apple.com>
532 * parser.c (cp_parser_objc_message_args): Check for missing message
533 arguments and syntax error.
535 2005-10-13 Fariborz Jahanian <fjahanian@apple.com>
538 * parser.c (cp_parser_objc_class_ivars): Check for @end/eof while
541 2005-08-15 Ziemowit Laski <zlaski@apple.com>
544 * parser.c (cp_parser_objc_interstitial_code): Catch stray
545 '{' and '}' tokens and issue appropriate errors.
547 2005-08-02 Ziemowit Laski <zlaski@apple.com>
550 (cp_parser_statement_seq_opt): In addition to '}' and
551 end-of-file, a statement sequence may also be terminated
554 2010-10-05 Joseph Myers <joseph@codesourcery.com>
556 * cp-tree.h (cxx_print_error_function,
557 cxx_initialize_diagnostics): Declare using diagnostic_context
560 2010-10-04 Andi Kleen <ak@linux.intel.com>
562 * Make-lang.in (g++, cc1plus): Add + to build rule.
564 2010-10-04 Jason Merrill <jason@redhat.com>
566 * tree.c (decl_storage_duration): New.
567 * cp-tree.h: Declare it.
568 (duration_kind): Return values.
570 2010-10-03 Jason Merrill <jason@redhat.com>
572 * typeck.c (require_complete_type_sfinae): Add complain parm to...
573 (require_complete_type): ...this function.
574 (cp_build_array_ref, convert_arguments): Use it.
575 (convert_for_initialization, cp_build_modify_expr): Likewise.
576 * cp-tree.h: Declare it.
577 * call.c (build_over_call): Use it.
579 2010-09-30 Iain Sandoe <iains@gcc.gnu.org>
581 merge from FSF 'apple/trunk' branch.
582 2006-01-30 Fariborz Jahanian <fjahanian@apple.com>
585 * cp/parser.c (cp_parser_objc_interstitial_code): For
586 @optional/@required set the optional/required flag.
588 2010-09-30 Nicola Pero <nicola.pero@meta-innovation.com>
590 * parser.c (cp_lexer_get_preprocessor_token): Tidied up comments
591 and indentation when finding an Objective-C++ CPP_AT_NAME token.
593 2010-09-29 Richard Guenther <rguenther@suse.de>
595 * cp-tree.h (CP_DECL_CONTEXT): Check DECL_FILE_SCOPE_P.
596 (CP_TYPE_CONTEXT): Similar.
597 (FROB_CONTEXT): Frob global_namespace to the global
598 TRANSLATION_UNIT_DECL.
599 * decl.c (cxx_init_decl_processing): Build a TRANSLATION_UNIT_DECL,
600 set DECL_CONTEXT of global_namespace to it.
601 (start_decl): Use CP_DECL_CONTEXT and test TYPE_P
602 instead of zeroing context.
603 (cp_finish_decl): Use DECL_FILE_SCOPE_P.
604 (grokfndecl): Likewise.
605 (start_preparsed_function): Likewise.
606 * name-lookup.c (maybe_push_decl): Use DECL_NAMESPACE_SCOPE_P.
607 (namespace_binding): Use SCOPE_FILE_SCOPE_P.
608 * pt.c (template_class_depth): Use CP_TYPE_CONTEXT.
609 (is_specialization_of_friend): Use CP_DECL_CONTEXT.
610 (push_template_decl_real): Likewise.
611 (tsubst_friend_class): Likewise. Adjust context comparisons.
612 (instantiate_class_template): Use CP_TYPE_CONTEXT.
613 (tsubst): Do not substitute into TRANSLATION_UNIT_DECL.
614 * cxx-pretty-print.c (pp_cxx_nested_name_specifier): Use
617 2010-09-29 Yao Qi <yao@codesourcery.com>
619 * decl.c (get_atexit_node): Fix typo.
621 2010-09-28 Jason Merrill <jason@redhat.com>
623 * tree.c (lvalue_kind): Rename from lvalue_p_1, make nonstatic.
624 (real_lvalue_p): Take const_tree.
626 * typeck.c (lvalue_or_else): Make temporary arg a permerror.
627 (cp_build_addr_expr_1): Likewise.
629 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
631 Partially merged from apple/trunk branch on FSF servers:
632 2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
633 Radar 3803157 (method attributes)
635 * parser.c (cp_parser_objc_method_keyword_params): Handle attributes.
636 (cp_parser_objc_method_tail_params_opt): Likewise.
637 (cp_parser_objc_method_signature): Likewise.
638 (cp_parser_objc_method_maybe_bad_prefix_attributes): New.
639 (cp_parser_objc_method_prototype_list): Handle attributes.
640 (cp_parser_objc_method_definition_list): Likewise.
642 2010-09-28 Richard Henderson <rth@redhat.com>
644 * cp-lang.c: Include "target.h".
645 (cp_eh_personality): Use targetm.except_unwind_info.
646 * Make-lang.in (cp-lang.o): Update deps.
648 2010-09-28 Iain Sandoe <iains@gcc.gnu.org>
650 * parser.c (cp_parser_objc_valid_prefix_attributes): New.
651 (cp_parser_declaration): Parse prefix attributes for ObjC++.
652 (cp_parser_objc_protocol_declaration): Handle attributes.
653 (cp_parser_objc_class_interface): Likewise.
654 (cp_parser_objc_declaration): Likewise.
656 2010-09-27 Jason Merrill <jason@redhat.com>
658 Require lvalues as specified by the standard.
659 * typeck.c (lvalue_or_else): Use real_lvalue_p.
660 (cp_build_addr_expr_1): Split out of cp_build_unary_op.
661 (cp_build_addr_expr, cp_build_addr_expr_strict): Interfaces.
662 (decay_conversion, get_member_function_from_ptrfunc): Adjust.
663 (build_x_unary_op, build_reinterpret_cast_1): Adjust.
664 (build_const_cast_1): Adjust.
665 * cp-tree.h: Declare new fns.
666 * call.c (build_this, convert_like_real, build_over_call): Adjust.
667 (initialize_reference): Adjust.
668 * class.c (build_base_path, convert_to_base_statically): Adjust.
669 (build_vfn_ref, resolve_address_of_overloaded_function): Adjust.
670 * cvt.c (build_up_reference, convert_to_reference): Adjust.
671 * decl.c (register_dtor_fn): Adjust.
672 * decl2.c (build_offset_ref_call_from_tree): Adjust.
673 * except.c (initialize_handler_parm): Adjust.
674 * init.c (build_offset_ref, build_delete, build_vec_delete): Adjust.
675 * rtti.c (build_dynamic_cast_1, tinfo_base_init): Adjust.
676 * tree.c (stabilize_expr): Adjust.
678 2010-09-27 Nicola Pero <nicola.pero@meta-innovation.com>
680 Merge from apple/trunk branch on FSF servers:
682 2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
685 * typeck.c (composite_pointer_type): Call objc_have_common_type
686 when comparing two objective-c pointer types.
688 2005-07-18 Ziemowit Laski <zlaski@apple.com>
691 * call.c (standard_conversion): Do not issue warnings when
692 comparing ObjC pointer types.
694 2005-06-22 Ziemowit Laski <zlaski@apple.com>
697 * call.c (standard_conversion): Allow for a pointer conversion
698 between any two ObjC pointer types.
699 * typeck.c (composite_pointer_type): Determine common type
700 for two ObjC pointer types.
702 2010-09-24 Jan Hubicka <jh@suse.cz>
704 * decl.c (finish_function): Use decl_replaceable_p
705 * method.c (make_alias_for_thunk): Update call of
706 cgraph_same_body_alias.
708 2010-09-24 Jason Merrill <jason@redhat.com>
710 * decl.c (compute_array_index_type): Remember type dependence of
712 * pt.c (dependent_type_p_r): Don't recompute it here.
714 * error.c (dump_expr) [CASE_CONVERT]: Print conversion between
715 reference and pointer to the same type as "*" or "&".
717 2010-09-24 Nicola Pero <nicola.pero@meta-innovation.com>
719 * typeck.c (warn_args_num): Use warning 'too many arguments to
720 method [methodname]' for an Objective-C method instead of the less
721 satisfactory 'too many arguments to function' (with no method
724 2010-09-21 Jason Merrill <jason@redhat.com>
726 * mangle.c (write_expression) [SCOPE_REF]: Only do -fabi-version=1
727 special handling if we know the member.
729 2010-09-18 Jason Merrill <jason@redhat.com>
731 * call.c (compare_ics): Do lvalue/rvalue reference binding
732 comparison for ck_list, too.
734 2010-09-15 Jason Merrill <jason@redhat.com>
736 * semantics.c (finish_id_expression): Diagnose use of function
737 parms in evaluated context outside function body.
739 * decl2.c (grokbitfield): Diagnose non-integral width.
741 * call.c (convert_like_real): Use the underlying type of the
742 reference for the temporary.
744 2010-09-15 Jakub Jelinek <jakub@redhat.com>
747 * class.c (build_vtbl_initializer): Use fn instead of init's operand
748 as first argument to FDESC_EXPR.
750 2010-09-15 Paolo Carlini <paolo.carlini@oracle.com>
753 * decl.c (grokdeclarator): Check build_memfn_type return value
756 2010-09-13 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
758 * semantics.c (finish_for_stmt): Always test flag_new_for_scope.
759 (begin_range_for_stmt): Likewise.
761 2010-09-11 Rodrigo Rivas <rodrigorivascosta@gmail.com>
763 Implement range-based for-statements.
764 * cp-tree.def (RANGE_FOR_STMT): New.
765 * cp-tree.h (RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY): New.
766 (cp_convert_range_for): Declare.
767 * pt.c (tsubst_expr): Add RANGE_FOR_STMT.
768 (tsubst_copy_and_build): perform_koenig_lookup takes extra argument.
769 * semantics.c (begin_range_for_stmt): New.
770 (finish_range_for_decl): New.
771 (finish_for_stmt): Accept also RANGE_FOR_STMT.
772 (perform_koenig_lookup): Add extra argument include_std.
773 * parser.c (cp_parser_c_for): New with code from
774 cp_parser_iteration_statement().
775 (cp_parser_range_for): New.
776 (cp_convert_range_for): New.
777 (cp_parser_iteration_statement): Add range-for support.
778 (cp_parser_condition): Adjust comment.
779 (cp_parser_postfix_expression): perform_koenig_lookup takes extra
781 * dump.c (cp_dump_tree): Add RANGE_FOR_STMT.
782 * cxx-pretty-print.c: Likewise.
783 * lex.c (cxx_init): Likewise.
784 * name-lookup.c (lookup_function_nonclass): Add extra argument
786 (lookup_arg_dependent): Likewise.
787 * name-lookup.h: Likewise.
789 2010-09-10 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
792 * error.c (maybe_warn_cpp0x): Add new warning
793 CPP0X_INLINE_NAMESPACES.
794 * parser.c (cp_parser_namespace_definition): Likewise.
795 * cp-tree.h (cpp0x_warn_str): Likewise.
797 2010-09-10 Richard Guenther <rguenther@suse.de>
799 * decl.c (reshape_init_vector): For VECTOR_TYPEs, use
800 TYPE_VECTOR_SUBPARTS instead of TYPE_DEBUG_REPRESENTATION_TYPE.
802 2010-09-10 Jan Hubicka <jh@suse.cz>
804 PR tree-optimization/45605
805 * cp/class.c (build_vtbl_initializer): Avoid wrong type conversion in
808 2010-09-08 Jakub Jelinek <jakub@redhat.com>
811 * pt.c (tsubst) <case INTEGER_TYPE>: Call mark_rvalue_use
812 before calling fold_decl_constant_value.
814 2010-09-07 Arnaud Charlet <charlet@adacore.com>
816 * cp-tree.h (build_enumerator): Add new location_t parameter.
817 (build_lang_decl_loc): New function.
818 * decl.c (build_enumerator): New parameter loc. Use it when calling
819 build_decl. Replace build_lang_decl with build_lang_decl_loc.
820 * pt.c (tsubst_enum): Adjust call to build_enumerator.
821 * parser.c (cp_parser_enumerator_definition): Ditto.
822 * lex.c (build_lang_decl_loc): New function.
824 2010-09-06 Dodji Seketeli <dodji@redhat.com>
829 * tree.c (strip_typedefs): Strip typedefs from the context of
832 2010-09-06 Mark Mitchell <mark@codesourcery.com>
834 * typeck.c (cp_build_binary_op): Call do_warn_double_promotion.
835 * call.c (build_conditional_expr): Likewise.
836 (convert_arg_to_ellipsis): Likewise.
838 2010-09-06 Arnaud Charlet <charlet@adacore.com>
840 * parser.c (make_pointer_declarator, make_reference_declarator,
841 make_call_declarator, make_array_declarator): Set declarator->id_loc.
842 (cp_parser_init_declarator): Adjust location of decl if appropriate.
844 2010-09-06 Jason Merrill <jason@redhat.com>
846 * call.c (implicit_conversion): Fix value-init of enums.
847 (convert_like_real): Likewise.
849 * decl.c (cp_finish_decl): Don't change init for auto deduction.
851 * pt.c (fold_non_dependent_expr_sfinae): Split out from...
852 (fold_non_dependent_expr): ...here.
853 (convert_nontype_argument): Use it. Take complain parm.
854 Use perform_implicit_conversion instead of ocp_convert.
855 Allow cv-qual changes.
856 (convert_template_argument): Pass complain down.
857 (tsubst_template_arg): Suppress constant expression warnings.
860 * method.c (synthesized_method_walk): In constructors, also check
861 subobject destructors.
863 * semantics.c (finish_compound_literal): Always build a
866 2010-08-30 Paolo Carlini <paolo.carlini@oracle.com>
869 * decl.c (grokdeclarator): Use MAIN_NAME_P only on IDENTIFIER_NODEs.
871 2010-08-30 Jakub Jelinek <jakub@redhat.com>
874 * parser.c (cp_parser_omp_atomic): Handle boolean
875 {PRE,POST}_INCREMENT.
877 2010-08-29 Jason Merrill <jason@redhat.com>
880 * parser.c (cp_parser_parameter_declaration): Pop parameter decls
881 after tentative parsing.
883 2010-08-22 Joseph Myers <joseph@codesourcery.com>
885 * Make-lang.in (g++spec.o): Update dependencies.
886 * g++spec.c: Include opts.h
887 (MATH_LIBRARY, LIBSTDCXX): Remove initial "-l".
888 (lang_specific_driver): Use cl_decoded_option structures.
890 2010-08-20 Nathan Froyd <froydnj@codesourcery.com>
892 * call.c: Use FOR_EACH_VEC_ELT.
897 * except.c: Likewise.
898 * mangle.c: Likewise.
899 * method.c: Likewise.
900 * name-lookup.c: Likewise.
901 * parser.c: Likewise.
904 * semantics.c: Likewise.
905 * typeck2.c: Likewise.
907 2010-08-19 Jason Merrill <jason@redhat.com>
909 * call.c (reference_related_p): Check for error_mark_node.
910 (add_function_candidate): Check it instead of
911 same_type_ignoring_top_level_qualifiers_p.
914 * init.c (build_new_1): Don't use build_value_init in a template.
915 (build_value_init): Make sure we don't.
918 * cp-gimplify.c (cp_gimplify_expr): Also remove assignment
919 of empty class CONSTRUCTOR.
921 * except.c (pending_noexcept, pending_noexcept_checks): New.
922 (perform_deferred_noexcept_checks): New.
923 (maybe_noexcept_warning): Split from...
924 (finish_noexcept_expr): ...here. Adjust.
925 * decl2.c (cp_write_global_declarations): Call
926 perform_deferred_noexcept_checks.
927 * cp-tree.h: And declare it.
929 2010-08-18 Nathan Froyd <froydnj@codesourcery.com>
932 * name-lookup.c (push_overloaded_decl): Change DECL_CHAIN to
935 2010-08-17 Kai Tietz <kai.tietz@onevision.com>
937 * class.c (note_name_declared_in_class): Make in 'extern "C"' blocks,
938 or if -fms-extensions is enabled check, check permissive.
940 2010-08-09 Jason Merrill <jason@redhat.com>
943 * pt.c (lookup_template_class): Don't re-coerce outer parms.
945 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
947 * call.c (add_builtin_candidates): Use VECs for local variable
948 `types'. Adjust remainder of function accordingly.
950 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
952 * name-lookup.c (is_associated_namespace): Convert local variables
953 to be VECs instead of TREE_LISTs.
955 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
957 * tree.c (varargs_function_p): Use stdarg_p.
959 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
961 * parser.c (cp_default_arg_entry): Declare. Declare a VEC of it.
962 (cp_unparsed_functions_entry): Declare. Declare a VEC of it.
963 (cp_parser) [unparsed_functions_queues]: Rename to unparsed_queues.
964 Change type to a VEC.
965 (unparsed_funs_with_default_args): Define.
966 (unparsed_funs_with_definitions): Define.
967 (push_unparsed_function_queues): New function.
968 (cp_parser_new): Call it.
969 (pop_unparsed_function_queues): New function.
970 (cp_parser_class_specifier): Adjust processing of unparsed functions.
971 (cp_parser_template_declaration_after_export): Use VEC_safe_push.
972 (cp_parser_save_member_function_body): Likewise.
973 (cp_parser_late_parsing_for_member): Call push_unparsed_function_queues
974 and pop_unparsed_function_queues.
975 (cp_parser_late_parsing_default_args): Likewise.
976 (cp_parser_save_default_args): Use VEC_safe_push.
978 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
980 * name-lookup.h (cp_label_binding): Declare. Declare a VEC type
982 (cp_binding_level): Convert shadowed_labels and dead_vars_from_for
984 * decl.c (poplevel): Adjust for type changes.
985 (declare_local_label): Likewise.
987 2010-08-06 Jason Merrill <jason@redhat.com>
989 * typeck.c (complete_type_or_maybe_complain): Split out from...
990 (complete_type_or_else): Here.
991 (build_class_member_access_expr): Call it.
992 (finish_class_member_access_expr): Likewise.
993 * call.c (build_special_member_call): Likewise.
994 * cvt.c (build_expr_type_conversion): Likewise.
995 * init.c (build_new): Likewise.
996 * typeck2.c (build_functional_cast): Likewise.
997 * cp-tree.h: Declare it.
999 * init.c (build_value_init): Add complain parm.
1000 (build_value_init_noctor): Likewise.
1001 (perform_member_init): Pass it.
1002 (expand_aggr_init_1): Likewise.
1003 (build_new_1): Likewise.
1004 (build_vec_init): Likewise.
1005 * pt.c (tsubst_expr): Likewise.
1006 * typeck2.c (build_functional_cast): Likewise.
1007 * cp-tree.h: Adjust.
1008 * tree.c (build_target_expr_with_type): Handle error_mark_node.
1010 * typeck.c (decay_conversion): Any expression with type nullptr_t
1013 2010-07-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1016 * decl.c (duplicate_decls): Merge DECL_USER_ALIGN and DECL_PACKED.
1018 2010-07-27 Jason Merrill <jason@redhat.com>
1020 * pt.c (tsubst_expr) [DECL_EXPR]: Handle getting an AGGR_INIT_EXPR
1021 from build_value_init.
1022 * init.c (build_value_init_noctor): Give error for unknown array
1025 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1027 * cp-objcp-common.h (LANG_HOOKS_MISSING_ARGUMENT): Remove.
1029 2010-07-27 Joseph Myers <joseph@codesourcery.com>
1031 * cp-objcp-common.c (cxx_initialize_diagnostics): First call
1032 c_common_initialize_diagnostics.
1033 * cp-objcp-common.h (LANG_HOOKS_OPTION_LANG_MASK,
1034 LANG_HOOKS_COMPLAIN_WRONG_LANG_P): Define.
1036 2010-07-21 Jason Merrill <jason@redhat.com>
1038 * tree.c (cp_tree_equal): Fix CONSTRUCTOR handling.
1040 * parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
1043 2010-07-20 Jeffrey Yasskin <jyasskin@google.com>
1046 * pt.c (instantiate_class_template): Propagate the template's
1047 location to its instance.
1049 2010-07-20 Jason Merrill <jason@redhat.com>
1052 * pt.c (tsubst_copy_and_build): Rework last change.
1055 * pt.c (tsubst_copy_and_build): Handle partial substitution of
1058 2010-07-19 Jason Merrill <jason@redhat.com>
1061 * semantics.c (finish_decltype_type): Correct decltype
1062 of parenthesized rvalue reference variable.
1065 * tree.c (cp_tree_equal): Compare type of *CAST_EXPR.
1066 * pt.c (iterative_hash_template_arg): Hash type of *CAST_EXPR.
1068 2010-07-19 Paolo Carlini <paolo.carlini@oracle.com>
1071 * typeck.c (build_x_compound_expr_from_list): Add tsubst_flags_t
1073 * cp-tree.h: Adjust declaration.
1074 * init.c (perform_member_init): Adjust caller.
1075 * decl.c (grok_reference_init, cp_finish_decl): Likewise.
1076 * typeck2.c (store_init_value): Likewise.
1077 (build_functional_cast): Pass complain argument to
1078 build_x_compound_expr_from_list.
1080 2010-07-16 Jason Merrill <jason@redhat.com>
1083 * pt.c (process_partial_specialization): Diagnose partial
1084 specialization after instantiation.
1085 (most_specialized_class): Add complain parm.
1087 * ptree.c (cxx_print_xnode): Handle TEMPLATE_INFO.
1089 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1091 * init.c (build_new_1): Use cp_build_function_call_nary instead of
1092 cp_build_function_call.
1094 2010-07-15 Jason Merrill <jason@redhat.com>
1097 * call.c (add_function_candidate): If we're working on an implicit
1098 declaration, don't consider candidates that won't match.
1099 * typeck.c (same_type_ignoring_top_level_qualifiers_p): Now a fn.
1100 * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): Adjust.
1103 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1104 (TYPE_HAS_USER_OPEQ): New.
1105 * decl.c (grok_special_member_properties): Set it.
1106 * class.c (add_implicitly_declared_members): Don't lazily declare
1107 constructors/operator= if a base or member has a user-declared one.
1108 (check_bases_and_members, check_bases): Adjust.
1109 (check_field_decls, check_field_decl): Adjust.
1111 2010-07-15 Anatoly Sokolov <aesok@post.ru>
1113 * decl.c (integer_three_node): Remove.
1114 (cxx_init_decl_processing): Do not initialize the integer_three_node.
1115 * cp-tree.h (integer_three_node): Remove.
1117 2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
1119 * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.
1121 * class.c: Likewise.
1122 * cp-gimplify.c: Likewise.
1124 * decl2.c: Likewise.
1126 * mangle.c: Likewise.
1127 * name-lookup.c: Likewise.
1128 * optimize.c: Likewise.
1129 * parser.c: Likewise.
1132 * search.c: Likewise.
1133 * semantics.c: Likewise.
1134 * typeck.c: Likewise.
1135 * typeck2.c: Likewise.
1137 2010-07-14 Jason Merrill <jason@redhat.com>
1139 * init.c (sort_mem_initializers): Rename "field_type" to "ctx".
1140 (build_field_list): Cache field type.
1142 Implement C++0x unrestricted unions (N2544)
1143 * class.c (check_field_decl): Loosen union handling in C++0x.
1144 * method.c (walk_field_subobs): Split out from...
1145 (synthesized_method_walk): ...here. Set msg before loops.
1146 (process_subob_fn): Check for triviality in union members.
1147 * init.c (sort_mem_initializers): Splice out uninitialized
1148 anonymous unions and union members.
1149 (push_base_cleanups): Don't automatically destroy anonymous unions
1152 2010-07-13 Jason Merrill <jason@redhat.com>
1155 * cp-tree.h (struct lang_type_class): Add has_user_opeq.
1156 (TYPE_HAS_USER_OPEQ): New.
1157 * decl.c (grok_special_member_properties): Set it.
1158 * class.c (add_implicitly_declared_members): Don't lazily declare
1159 constructors/operator= if a base or member has a user-declared one.
1160 (check_bases_and_members, check_bases): Adjust.
1161 (check_field_decls, check_field_decl): Adjust.
1162 * method.c (synthesized_method_walk): Initialize check_vdtor.
1165 * mangle.c (write_type): Canonicalize.
1166 (canonicalize_for_substitution): Retain cv-quals on FUNCTION_TYPE.
1167 (write_CV_qualifiers_for_type): Ignore them in abi>=5.
1169 2010-07-13 Paolo Carlini <paolo.carlini@oracle.com>
1172 * call.c (convert_like_real): Adjust convert_ptrmem call, pass
1174 * typeck.c (get_delta_difference): Update prototype, add a
1175 tsubst_flags_t parameter; update get_delta_difference_1 calls and
1176 add checks for error_mark_node.
1177 (get_delta_difference_1): Update prototype, add a tsubst_flags_t
1178 parameter; update lookup_base call.
1179 (build_ptrmemfunc): Update prototype, add a tsubst_flags_t
1180 parameter; update get_delta_difference call and add check for
1182 (convert_ptrmem): Update prototype, add a tsubst_flags_t
1183 parameter; update get_delta_difference call and add check for
1184 error_mark_node; update build_ptrmemfunc call.
1185 (build_static_cast_1): Adjust convert_ptrmem call.
1186 (expand_ptrmemfunc_cst): Adjust get_delta_difference call.
1187 (cp_build_unary_op): Adjust build_ptrmemfunc call.
1188 * cvt.c (cp_convert_to_pointer, convert_force): Adjust convert_ptrmem
1189 and build_ptrmemfunc calls.
1190 * cp-tree.h: Update build_ptrmemfunc and convert_ptrmem prototypes.
1192 2010-07-12 Paolo Carlini <paolo.carlini@oracle.com>
1195 * call.c (build_temp): Add tsubst_flags_t complain parameter;
1196 adjust build_special_member_call call, pass complain.
1197 (convert_like_real): Adjust build_temp call, pass complain.
1199 2010-07-09 Jason Merrill <jason@redhat.com>
1202 * cp-tree.h (BV_LOST_PRIMARY): New macro.
1203 * class.c (update_vtable_entry_for_fn): Fix covariant thunk logic.
1204 Set BV_LOST_PRIMARY.
1205 (build_vtbl_initializer): Check BV_LOST_PRIMARY.
1207 2010-07-08 Jason Merrill <jason@redhat.com>
1210 * class.c (update_vtable_entry_for_fn): Fix handling of dummy
1211 virtual bases for covariant thunks.
1213 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
1215 * cp-tree.h: Do not include toplev.h.
1217 2010-07-06 Jason Merrill <jason@redhat.com>
1220 * call.c (is_std_init_list): Look through typedefs.
1223 * init.c (build_offset_ref): If scope isn't dependent,
1224 don't exit early. Look at TYPE_MAIN_VARIANT.
1225 * pt.c (tsubst_copy) [OFFSET_REF]: Do substitution.
1227 * error.c (dump_function_decl): Don't crash on null DECL_NAME.
1229 2010-07-06 Shujing Zhao <pearly.zhao@oracle.com>
1231 * cp-tree.h (impl_conv_void): New type.
1232 (convert_to_void): Adjust prototype.
1233 * cvt.c (convert_to_void): Use impl_conv_void, emit and adjust the
1234 diagnostic for easy translation. Change caller.
1235 * typeck.c: Update call to convert_to_void.
1236 * semantics.c: Likewise.
1239 2010-07-05 Nathan Froyd <froydnj@codesourcery.com>
1241 * decl.c (cp_finish_decl): Call add_local_decl.
1242 * optimize.c (clone_body): Adjust for new type of cfun->local_decls.
1244 2010-07-05 Paolo Carlini <paolo.carlini@oracle.com>
1246 * pt.c (tsubst): Early declare code = TREE_CODE (t) and use it
1249 2010-07-05 Shujing Zhao <pearly.zhao@oracle.com>
1252 * parser.c (cp_parser_primary_expression): Error if local template is
1255 2010-07-02 Le-Chun Wu <lcwu@google.com>
1258 * name-lookup.c (pushdecl_maybe_friend): Warn when a local decl
1259 (variable or type) shadows another type.
1261 2010-07-02 Jakub Jelinek <jakub@redhat.com>
1264 * typeck.c (convert_for_assignment): When converting a convertible
1265 vector type or objc++ types, call mark_rvalue_use.
1266 * typeck2.c (build_m_component_ref): Use return values from
1267 mark_rvalue_use or mark_lvalue_use.
1268 * class.c (build_base_path): Likewise.
1269 * call.c (build_conditional_expr): Likewise.
1271 2010-07-02 Paolo Carlini <paolo.carlini@oracle.com>
1274 * pt.c (tsubst_baselink): Return error_mark_node if lookup_fnfields
1277 2010-07-01 Richard Guenther <rguenther@suse.de>
1279 * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs
1280 predicate we are looking for, allow non-gimplified
1283 2010-06-30 Paolo Carlini <paolo.carlini@oracle.com>
1286 * typeck.c (cp_build_unary_op): Early return error_mark_node when
1287 arg is NULL_TREE too.
1288 * call.c (convert_class_to_reference): Return error_mark_node when
1291 2010-06-30 Michael Matz <matz@suse.de>
1293 * repo.c (finish_repo): Fix typo.
1295 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1297 * parser.c (cp_parser_omp_for_loop): Use a VEC for for_block.
1299 2010-06-30 Nathan Froyd <froydnj@codesourcery.com>
1301 * repo.c (pending_repo): Change type to a VEC.
1302 (finish_repo): Adjust for new type of pending_repo.
1303 (repo_emit_p): Likewise.
1305 2010-06-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
1307 * tree.c: Include gimple.h. Do not include tree-flow.h
1308 * decl.c: Do not include tree-flow.h
1309 * Make-lang.in: Adjust dependencies.
1311 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1313 * decl.c (incomplete_var): Declare. Declare VECs containing them.
1314 (incomplete_vars): Adjust comment. Change type to a VEC.
1315 (maybe_register_incomplete_var): Adjust for new type.
1316 (complete_vars): Adjust iteration over incomplete_vars.
1318 2010-06-29 Nathan Froyd <froydnj@codesourcery.com>
1320 * decl.c (struct named_label_entry): Change type of bad_decls field
1322 (poplevel_named_label_1): Adjust for new type of bad_decls.
1323 (check_goto): Likewise.
1325 2010-06-29 Jason Merrill <jason@redhat.com>
1327 Enable implicitly declared move constructor/operator= (N3053).
1328 * class.c (add_implicitly_declared_members): A class with no
1329 explicitly declared copy or move constructor gets both declared
1330 implicitly, and similarly for operator=.
1331 (check_bases): A type with no copy ctor does not inhibit
1332 a const copy ctor in a derived class. It does mean the derived
1334 (check_field_decl): Likewise.
1335 (check_bases_and_members): A nonexistent copy ctor/op= is non-trivial.
1336 * tree.c (type_has_nontrivial_copy_init): Adjust semantics.
1337 (trivially_copyable_p): Likewise.
1338 * call.c (convert_like_real): Use type_has_nontrivial_copy_init.
1339 * class.c (finish_struct_bits): Likewise.
1340 * tree.c (build_target_expr_with_type): Likewise.
1341 * typeck2.c (store_init_value): Likewise.
1343 Enable implicitly deleted functions (N2346)
1344 * class.c (check_bases_and_members): Adjust lambda flags.
1345 * method.c (implicitly_declare_fn): Set DECL_DELETED_FN if appropriate.
1347 * decl2.c (mark_used): Adjust error for use of deleted function.
1349 Machinery to support implicit delete/move.
1350 * cp-tree.h: (struct lang_type_class): Add lazy_move_assign,
1351 has_complex_move_ctor, has_complex_move_assign bitfields.
1352 (CLASSTYPE_LAZY_MOVE_ASSIGN): New.
1353 (TYPE_HAS_COMPLEX_MOVE_ASSIGN): New.
1354 (TYPE_HAS_COMPLEX_MOVE_CTOR): New.
1355 (enum special_function_kind): Add sfk_move_assignment.
1356 (LOOKUP_SPECULATIVE): New.
1357 * call.c (build_over_call): Return early if it's set.
1358 (build_over_call): Use trivial_fn_p.
1359 * class.c (check_bases): If the base has no default constructor,
1360 the derived one is non-trivial. Handle move ctor/op=.
1361 (check_field_decl): Likewise.
1362 (check_bases_and_members): Handle move ctor/op=.
1363 (add_implicitly_declared_members): Handle CLASSTYPE_LAZY_MOVE_ASSIGN.
1364 (type_has_move_constructor, type_has_move_assign): New.
1365 * decl.c (grok_special_member_properties): Handle move ctor/op=.
1366 * method.c (type_has_trivial_fn, type_set_nontrivial_flag): New.
1367 (trivial_fn_p): New.
1368 (do_build_copy_constructor): Use it.
1369 (do_build_assign_ref): Likewise. Handle move assignment.
1370 (build_stub_type, build_stub_object, locate_fn_flags): New.
1371 (locate_ctor): Use locate_fn_flags.
1372 (locate_copy, locate_dtor): Remove.
1373 (get_dtor, get_default_ctor, get_copy_ctor, get_copy_assign): New.
1374 (process_subob_fn, synthesized_method_walk): New.
1375 (maybe_explain_implicit_delete): New.
1376 (implicitly_declare_fn): Use synthesized_method_walk,
1377 type_has_trivial_fn, and type_set_nontrivial_flag.
1378 (defaulted_late_check): Set DECL_DELETED_FN.
1379 (defaultable_fn_check): Handle sfk_move_assignment.
1380 (lazily_declare_fn): Clear CLASSTYPE_LAZY_* early. Don't declare
1381 implicitly deleted move ctor/op=.
1382 * search.c (lookup_fnfields_1): Handle sfk_move_assignment.
1383 (lookup_fnfields_slot): New.
1384 * semantics.c (omp_clause_info_fndecl): Remove.
1385 (cxx_omp_create_clause_info): Use get_default_ctor, get_copy_ctor,
1386 get_copy_assign, trivial_fn_p.
1387 (trait_expr_value): Adjust call to locate_ctor.
1388 * tree.c (special_function_p): Handle sfk_move_assignment.
1390 * class.c (type_has_virtual_destructor): New.
1391 * cp-tree.h: Declare it.
1392 * semantics.c (trait_expr_value): Use it.
1394 * call.c (build_over_call): Only give warnings with tf_warning.
1396 * name-lookup.c (pop_scope): Handle NULL_TREE.
1398 * cp-tree.h (TYPE_HAS_ASSIGN_REF): Rename to TYPE_HAS_COPY_ASSIGN.
1399 (TYPE_HAS_CONST_ASSIGN_REF): Rename to TYPE_HAS_CONST_COPY_ASSIGN.
1400 (TYPE_HAS_INIT_REF): Rename to TYPE_HAS_COPY_CTOR.
1401 (TYPE_HAS_CONST_INIT_REF): Rename to TYPE_HAS_CONST_COPY_CTOR.
1402 (TYPE_HAS_COMPLEX_ASSIGN_REF): Rename to TYPE_HAS_COMPLEX_COPY_ASSIGN.
1403 (TYPE_HAS_COMPLEX_INIT_REF): Rename to TYPE_HAS_COMPLEX_COPY_CTOR.
1404 (TYPE_HAS_TRIVIAL_ASSIGN_REF): Rename to TYPE_HAS_TRIVIAL_COPY_ASSIGN.
1405 (TYPE_HAS_TRIVIAL_INIT_REF): Rename to TYPE_HAS_TRIVIAL_COPY_CTOR.
1406 (CLASSTYPE_LAZY_ASSIGNMENT_OP): Rename to CLASSTYPE_LAZY_COPY_ASSIGN.
1407 (sfk_assignment_operator): Rename to sfk_copy_assignment.
1408 * decl.c, call.c, class.c, init.c, method.c, pt.c, ptree.c: Adjust.
1409 * search.c, semantics.c, tree.c: Adjust.
1411 * pt.c (dependent_scope_ref_p): Remove.
1412 (value_dependent_expression_p): Don't call it.
1413 (type_dependent_expression_p): Here either.
1414 * init.c (build_offset_ref): Set TREE_TYPE on a qualified-id
1415 if the scope isn't dependent.
1417 * pt.c (convert_nontype_argument): Use mark_lvalue_use if we want
1421 * pt.c (has_value_dependent_address): New.
1422 (value_dependent_expression_p): Check it.
1423 (convert_nontype_argument): Likewise. Call decay_conversion before
1424 folding if we want a pointer.
1425 * semantics.c (finish_id_expression): Don't add SCOPE_REF if the
1426 scope is the current instantiation.
1428 2010-06-28 Jakub Jelinek <jakub@redhat.com>
1431 * class.c (build_base_path): If want_pointer, call mark_rvalue_use
1434 2010-06-28 Steven Bosscher <steven@gcc.gnu.org>
1436 * init.c: Do not include except.h.
1439 * cp-lang.c: Likewise.
1441 * semantics.c: Likewise.
1442 * decl2.c: Likewise.
1443 * except.c: Likewise.
1444 (init_exception_processing): Do not set the removed
1445 lang_protect_cleanup_actions here.
1446 (cp_protect_cleanup_actions): Make non-static and remove prototype.
1447 (doing_eh): New, moved from except.c but removed the do_warning flag.
1448 (expand_start_catch_block): Update doing_eh call.
1449 (expand_end_catch_block): Likewise.
1450 (build_throw): Likewise.
1451 * cp-tree.h: Prototype cp_protect_cleanup_actions.
1452 * cp-objcp-common.h: Set LANG_HOOKS_EH_PROTECT_CLEANUP_ACTIONS to
1453 cp_protect_cleanup_actions.
1454 * Make-lang.in: Update dependencies.
1456 2010-06-26 Jason Merrill <jason@redhat.com>
1458 * call.c (add_function_candidate): Set LOOKUP_COPY_PARM for any
1459 constructor called with a single argument that takes a reference
1460 to the constructor's class.
1461 (BAD_CONVERSION_RANK): New.
1462 (compare_ics): Use it to compare bad ICSes.
1464 2010-06-25 Joseph Myers <joseph@codesourcery.com>
1466 * lang-specs.h: Remove +e handling.
1468 2010-06-24 Andi Kleen <ak@linux.intel.com>
1470 * parser.c: (cp_parser_question_colon_clause):
1471 Switch to use cp_lexer_peek_token.
1472 Call warn_for_omitted_condop. Call pedwarn for omitted
1475 2010-06-22 Jakub Jelinek <jakub@redhat.com>
1478 * typeck2.c (build_m_component_ref): Call mark_lvalue_use on
1479 datum and mark_rvalue_use on component.
1482 * error.c (dump_expr): Don't look at CALL_EXPR_ARG (t, 0) if
1483 the CALL_EXPR has no arguments.
1485 2010-06-21 Jason Merrill <jason@redhat.com>
1487 * typeck.c (comp_except_specs): Fix ce_derived with noexcept.
1489 * semantics.c (check_trait_type): Check COMPLETE_TYPE_P for array
1492 2010-06-17 Nathan Froyd <froydnj@codesourcery.com>
1494 * name-lookup.c (struct arg_lookup): Convert namespaces and
1495 classes fields to VEC.
1496 (arg_assoc_namespace): Adjust for new type of namespaces.
1497 (arg_assoc_class): Adjust for new type of classes.
1498 (lookup_arg_dependent): Use make_tree_vector and
1499 release_tree_vector.
1500 * typeck2.c (build_x_arrow): Use vec_member.
1502 2010-06-17 Manuel López-Ibáñez <manu@gcc.gnu.org>
1505 * error.c (dump_decl): Better wording for anonymous namespace.
1507 2010-06-16 Nathan Froyd <froydnj@codesourcery.com>
1509 * class.c (build_vtbl_initializer): Adjust computation of new_position
1510 and which entry to add padding for.
1512 2010-06-16 Jason Merrill <jason@redhat.com>
1514 * except.c (check_noexcept_r): Return the problematic function.
1515 (finish_noexcept_expr): Give -Wnoexcept warning. Add complain parm.
1516 * pt.c (tsubst_copy_and_build): Pass it.
1517 * parser.c (cp_parser_unary_expression): Likewise.
1518 * cp-tree.h: Adjust prototype.
1520 * method.c (defaulted_late_check): Give the defaulted method
1521 the same exception specification as the implicit declaration.
1523 2010-06-15 Jason Merrill <jason@redhat.com>
1525 * class.c (add_implicitly_declared_members): Implicit assignment
1526 operators can also be virtual overriders.
1527 * method.c (lazily_declare_fn): Likewise.
1529 * call.c (convert_like_real): Give "initializing argument of"
1530 information for ambiguous conversion. Give source position
1533 * call.c (print_z_candidates): Do print viable deleted candidates.
1534 (joust): Don't choose a deleted function just because its worst
1535 conversion is better than another candidate's worst.
1537 * call.c (convert_like_real): Don't complain about
1538 list-value-initialization from an explicit constructor.
1540 * decl.c (duplicate_decls): Use DECL_IS_BUILTIN rather than test
1541 DECL_SOURCE_LOCATION directly.
1543 * class.c (type_has_user_provided_default_constructor): Use
1546 * call.c (is_subseq): Handle ck_aggr, ck_list.
1547 (compare_ics): Treat an aggregate or ambiguous conversion to the
1548 same type as involving the same function.
1550 2010-06-13 Shujing Zhao <pearly.zhao@oracle.com>
1552 * typeck.c (convert_for_assignment): Fix comment. Change message
1553 format from %d to %qP.
1554 (convert_for_initialization): Fix comment.
1556 2010-06-11 Shujing Zhao <pearly.zhao@oracle.com>
1558 * cp-tree.h (expr_list_kind): New type.
1559 (impl_conv_rhs): New type.
1560 (build_x_compound_expr_from_list, convert_for_initialization): Adjust
1562 (typeck.c (convert_arguments): Use impl_conv_rhs and emit the
1563 diagnostics for easy translation. Change caller.
1564 (convert_for_initialization): Use impl_conv_rhs and change caller.
1565 (build_x_compound_expr_from_list): Use expr_list_kind and emit the
1566 diagnostics for easy translation. Change caller.
1567 * decl.c (bad_spec_place): New enum.
1568 (bad_specifiers): Use it and emit the diagnostics for easy
1569 translation. Change caller.
1570 * pt.c (coerce_template_parms): Put the diagnostics in full sentence.
1572 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1574 * cp-tree.h (struct saved_scope): Change decl_ns_list field type
1576 * decl2.c (cp_write_global_declarations): Adjust for new type of
1577 decl_namespace_list.
1578 * name-lookup.c (current_decl_namespace): Likewise.
1579 (push_decl_namespace): Likewise.
1580 (pop_decl_namespace): Likewise.
1582 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1584 * call.c (build_java_interface_fn_ref): Call build_function_type_list
1585 instead of build_function_type.
1586 * decl.c (cxx_init_decl_processing): Likewise.
1587 (declare_global_var): Likewise.
1588 (get_atexit_node): Likewise.
1589 (expand_static_init): Likewise.
1590 * decl2.c (start_objects): Likewise.
1591 (start_static_storage_duration_function): Likewise.
1592 * except.c (init_exception_processing): Likewise.
1593 (build_exc_ptr): Likewise.
1594 (build_throw): Likewise.
1595 * rtti.c (throw_bad_cast): Likewise.
1596 (throw_bad_typeid): Likewise.
1597 (build_dynamic_cast_1): Likewise.
1599 2010-06-09 Nathan Froyd <froydnj@codesourcery.com>
1601 * call.c (build_call_n): Call XALLOCAVEC instead of alloca.
1602 (build_op_delete_call): Likewise.
1603 (build_over_call): Likewise.
1604 * cp-gimplify.c (cxx_omp_clause_apply_fn): Likewise.
1605 * pt.c (process_partial_specialization): Likewise.
1606 (tsubst_template_args): Likewise.
1607 * semantics.c (finish_asm_stmt): Likewise.
1609 2010-06-08 Nathan Sidwell <nathan@codesourcery.com>
1611 * decl.c (record_key_method_defined): New, broken out of ...
1612 (finish_function): ... here. Call it.
1613 (start_decl): Treat aliases as definitions.
1615 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1617 * typeck2.c (abstract_virtuals_error): Use typed GC allocation.
1619 * pt.c (maybe_process_partial_specialization): Likewise.
1620 (register_specialization): Likewise.
1621 (add_pending_template): Likewise.
1622 (lookup_template_class): Likewise.
1623 (push_tinst_level): Likewise.
1625 * parser.c (cp_lexer_new_main): Likewise.
1626 (cp_lexer_new_from_tokens): Likewise.
1627 (cp_token_cache_new): Likewise.
1628 (cp_parser_context_new): Likewise.
1629 (cp_parser_new): Likewise.
1630 (cp_parser_nested_name_specifier_opt): Likewise.
1631 (cp_parser_template_id): Likewise.
1633 * name-lookup.c (binding_entry_make): Likewise.
1634 (binding_table_construct): Likewise.
1635 (binding_table_new): Likewise.
1636 (cxx_binding_make): Likewise.
1637 (pushdecl_maybe_friend): Likewise.
1638 (begin_scope): Likewise.
1639 (push_to_top_level): Likewise.
1641 * lex.c (init_reswords): Likewise.
1642 (retrofit_lang_decl): Likewise.
1643 (cxx_dup_lang_specific_decl): Likewise.
1644 (copy_lang_type): Likewise.
1645 (cxx_make_type): Likewise.
1647 * decl.c (make_label_decl): Likewise.
1648 (check_goto): Likewise.
1649 (start_preparsed_function): Likewise.
1650 (save_function_data): Likewise.
1652 * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise.
1654 * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise.
1656 * class.c (finish_struct_1): Likewise.
1658 * cp-tree.h (struct lang_type): Add variable_size GTY option.
1659 (struct lang_decl): Likewise.
1661 * parser.c (cp_parser_new): Update comment to not reference
1664 2010-06-07 Jason Merrill <jason@redhat.com>
1667 * error.c (dump_parameters): Mask out TFF_SCOPE.
1668 (dump_simple_decl): Don't print the scope of a PARM_DECL.
1669 (dump_scope): Remove no-op mask.
1672 * parser.c (cp_parser_lookup_name): Fix naming the constructor.
1674 * cp-tree.h (COMPLETE_OR_OPEN_TYPE_P): New macro.
1675 * init.c (build_offset_ref): Use it.
1676 * pt.c (maybe_process_partial_specialization): Use it.
1677 (instantiate_class_template): Use it.
1678 * search.c (lookup_base): Use it.
1680 2010-06-07 Jakub Jelinek <jakub@redhat.com>
1683 * expr.c (mark_exp_read): Handle INDIRECT_REF.
1684 * cvt.c (convert_to_void): Handle INDIRECT_REF like
1685 handled_component_p.
1688 * decl.c (initialize_local_var): If TREE_USED is set on the type,
1689 set also DECL_READ_P on the decl.
1691 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1694 * cp-tree.h (typedef_variant_p): Move this declaration to
1696 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1697 * decl.c (grokdeclarator): Do not rename debug info of an
1698 anonymous tagged type named by a typedef.
1700 2010-06-05 Fabien Chêne <fabien@gcc.gnu.org>
1703 * class.c (check_field_decls): Move the call to
1704 check_bitfield_decl before trying to set the
1705 CLASSTYPE_READONLY_FIELDS_NEED_INIT flag.
1707 2010-06-05 Steven Bosscher <steven@gcc.gnu.org>
1709 * typeck.c: Update include path for moved files.
1712 * cp-gimplify.c: Likewise.
1713 * cp-lang.c: Likewise.
1715 * semantics.c: Likewise.
1716 * cxx-pretty-print.h: Likewise.
1717 * decl2.c: Likewise.
1718 * parser.c: Likewise.
1719 * cp-objcp-common.c: Likewise.
1720 * cp-tree.h: Likewise.
1721 * name-lookup.c: Likewise.
1723 * name-lookup.h: Likewise.
1724 * config-lang.in: Update paths in gtfiles for files in c-family/.
1725 * Make-lang.in: Likewise.
1727 2010-06-04 Magnus Fromreide <magfr@lysator.liu.se>
1729 * cvt.c (cp_convert_to_pointer): Use null_ptr_cst_p.
1730 * typeck.c (build_ptrmemfunc): Likewise.
1732 2010-06-04 Jason Merrill <jason@redhat.com>
1734 * typeck2.c (merge_exception_specifiers): Adjust merging of
1735 throw() and noexcept(true).
1737 * pt.c (value_dependent_expression_p) [NOEXCEPT_EXPR]: Avoid
1738 using an uninitialized variable.
1740 * cxx-pretty-print.c (pp_cxx_unary_expression): Handle NOEXCEPT_EXPR.
1741 (pp_cxx_expression): Likewise.
1743 Implement noexcept-specification (15.4)
1744 * parser.c (cp_parser_exception_specification_opt): Parse it.
1745 Give -Wdeprecated warning about throw() specs.
1746 * pt.c (tsubst_exception_specification): Handle it.
1747 * error.c (dump_exception_spec): Handle it.
1748 (dump_expr): Handle NOEXCEPT_EXPR.
1749 * cxx-pretty-print.c (pp_cxx_exception_specification): Likewise.
1750 * typeck.c (comp_except_specs): Handle compatibility rules.
1751 Change exact parm to take an enum.
1752 * typeck2.c (merge_exception_specifiers): Handle noexcept.
1753 * except.c (nothrow_spec_p, type_noexcept_p): New fns.
1754 (type_throw_all_p, build_noexcept_spec): New fns.
1755 * cp-tree.h (TYPE_NOTHROW_P, TYPE_NOEXCEPT_P): Use them.
1756 (comp_except_specs): Define ce_derived, ce_normal, ce_exact enums.
1757 (cp_tree_index): Add CPTI_NOEXCEPT_TRUE_SPEC, CPTI_NOEXCEPT_FALSE_SPEC.
1758 (noexcept_true_spec, noexcept_false_spec): New macros.
1759 * name-lookup.c (pushdecl_maybe_friend): Adjust.
1760 * search.c (check_final_overrider): Adjust.
1761 * decl.c (check_redeclaration_exception_specification): Adjust.
1762 (use_eh_spec_block): Use type_throw_all_p.
1763 (cxx_init_decl_processing): Set noexcept_false_spec,noexcept_true_spec.
1764 Give operator new a noexcept-specification in C++0x mode.
1765 * tree.c (build_exception_variant, cxx_type_hash_eq): Adjust.
1766 (cp_build_type_attribute_variant): Don't test TYPE_RAISES_EXCEPTIONS.
1768 Implement noexcept operator (5.3.7)
1769 * cp-tree.def (NOEXCEPT_EXPR): New.
1770 * except.c (check_noexcept_r, finish_noexcept_expr): New.
1771 * cp-tree.h: Declare finish_noexcept_expr.
1772 * parser.c (cp_parser_unary_expression): Parse noexcept-expression.
1773 * pt.c (tsubst_copy_and_build): And tsubst it.
1774 (type_dependent_expression_p): Handle it.
1775 (value_dependent_expression_p): Handle it.
1777 * call.c (build_conditional_expr): Never fold in unevaluated context.
1778 * tree.c (build_aggr_init_expr): Propagate TREE_NOTHROW.
1779 * semantics.c (simplify_aggr_init_expr): Likewise.
1780 * typeck.c (merge_types): Call merge_exception_specifiers.
1781 * decl.c (duplicate_decls): Check DECL_SOURCE_LOCATION rather than
1782 DECL_ANTICIPATED for preferring new type.
1784 2010-06-04 Joseph Myers <joseph@codesourcery.com>
1786 * g++spec.c (lang_specific_driver): Use GCC-specific formats in
1789 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1792 * typeck.c (build_class_member_access_expr): Call mark_exp_read
1793 on object for static data members.
1795 2010-06-04 Jakub Jelinek <jakub@redhat.com>
1796 Jason Merrill <jason@redhat.com>
1799 * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
1800 with the same type, call mark_lvalue_use on both.
1802 2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
1804 * class.c (struct vtbl_init_data_s): Remove last_init field.
1805 (struct secondary_vptr_vtt_init_data_s): Change type of inits field
1807 (finish_vtbls): Use a VEC rather than a TREE_LIST for the accumulated
1809 (build_vtt): Likewise.
1810 (initialize_vtable): Take a VEC instead of a tree.
1811 (build_vtt_inits): Change return type to void. Take a VEC **
1812 instead of a tree *; accumulate results into said VEC.
1813 (build_ctor_vtbl_group): Use a VEC rather than a TREE_LIST for the
1814 accumulated initializers. Pass the vtable to accumulate_vtbl_inits.
1815 (accumulate_vtbl_inits): Add extra vtable tree parameter; take a VEC
1817 (dfs_accumulate_vtbl_inits): Likewise. Change return type to void.
1818 (build_vtbl_initializer): Add VEC parameter; accumulate initializers
1820 (dfs_build_secondary_vptr_vtt_inits): Use CONSTRUCTOR_APPEND_ELT
1821 rather than tree_cons.
1822 (build_vbase_offset_vtbl_entries): Likewise.
1823 (add_vcall_offset): Likewise.
1824 (build_rtti_vtbl_entries): Likewise.
1825 * cp-tree.h (initialize_artificial_var): Take a VEC instead of a tree.
1826 * decl.c (initialize_artificial_var): Use build_constructor instead
1827 of build_constructor_from_list.
1829 2010-06-03 H.J. Lu <hongjiu.lu@intel.com>
1832 * class.c (layout_class_type): Check MAX_FIXED_MODE_SIZE on
1835 2010-06-02 Jonathan Wakely <jwakely.gcc@gmail.com>
1837 * parser.c (cp_parser_mem_initializer_list): Change error text.
1839 2010-06-02 Jakub Jelinek <jakub@redhat.com>
1841 * cp-objcp-common.c (shadowed_var_for_decl): Change into
1842 tree_decl_map hashtab from tree_map.
1843 (decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Adjust.
1844 (init_shadowed_var_for_decl): Adjust initialization.
1847 * cvt.c (convert_to_void): If implicit is NULL, call mark_rvalue_use
1848 instead of calling mark_exp_read only when not an assignment.
1851 * semantics.c (finalize_nrv): Don't copy DECL_ARTIFICIAL, DECL_IGNORED_P,
1852 DECL_SOURCE_LOCATION and DECL_ABSTRACT_ORIGIN from var to result.
1853 Set DECL_VALUE_EXPR on var.
1855 2010-06-02 Jason Merrill <jason@redhat.com>
1857 * error.c (dump_type): Improve typedef handling.
1862 * name-lookup.c (same_entity_p): New.
1863 (ambiguous_decl): Multiple declarations of the same entity
1866 2010-06-01 Jason Merrill <jason@redhat.com>
1869 * call.c (add_list_candidates): Prefer the default constructor.
1870 (build_aggr_conv): Treat missing initializers like { }.
1871 * typeck2.c (process_init_constructor_record): Likewise.
1872 * init.c (expand_default_init): Use digest_init for
1873 direct aggregate initialization, too.
1875 * call.c (add_list_candidates): Split out...
1876 (build_user_type_conversion_1): ...from here.
1877 (build_new_method_call): And here.
1878 (implicit_conversion): Propagate LOOKUP_NO_NARROWING.
1881 * call.c (build_list_conv): Set list-initialization flags properly.
1883 2010-06-01 Nathan Froyd <froydnj@codesourcery.com>
1885 * typeck2.c (build_x_arrow): Make types_memoized a VEC.
1887 2010-06-01 Arnaud Charlet <charlet@adacore.com>
1888 Matthew Gingell <gingell@adacore.com>
1890 * Make-lang.in (CXX_C_OBJS): Add c-ada-spec.o.
1891 * decl2.c: Include langhooks.h and c-ada-spec.h.
1892 (cpp_check, collect_source_refs, collect_ada_namespace,
1893 collect_all_refs): New functions.
1894 (cp_write_global_declarations): Add handling of -fdump-ada-spec.
1895 * lang-specs.h: Ditto.
1897 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1899 * cp-tree.h (cp_build_function_call_nary): Declare.
1900 * typeck.c (cp_build_function_call_nary): Define.
1901 * decl.c (register_dtor_fn): Use it instead of
1902 cp_build_function_call.
1903 (cxx_maybe_build_cleanup): Likewise.
1904 * decl2.c (generate_ctor_or_dtor_function): Likewise.
1905 * except.c (do_get_exception_ptr): Likewise.
1906 (do_begin_catch): Likewise.
1907 (do_allocate_exception): Likewise.
1908 (do_free_exception): Likewise.
1909 (build_throw): Likewise. Use cp_build_function_call_vec instead
1910 of cp_build_function_call.
1911 (do_end_catch): Likewise.
1913 2010-05-29 Nathan Froyd <froydnj@codesourcery.com>
1915 * cp-tree.h (struct cp_decl_specifier_seq): Move type_location field up.
1916 (struct cp_declarator): Move id_loc field up.
1918 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1920 * cp-tree.h (ATTRIBUTE_GCC_CXXDIAG): Remove. Require that
1921 this file is included before c-common.h. Define GCC_DIAG_STYLE
1922 before including diagnostic-core.h and toplev.h.
1923 (pedwarn_cxx98): Use ATTRIBUTE_GCC_DIAG.
1924 * pt.c: Include cp-tree.h before c-common.h.
1926 2010-05-29 Steven Bosscher <steven@gcc.gnu.org>
1928 * tree.c (c_register_addr_space): Add stub.
1930 2010-05-28 Joseph Myers <joseph@codesourcery.com>
1932 * g++spec.c (lang_specific_driver): Use fatal_error instead of
1935 2010-05-28 Dodji Seketeli <dodji@redhat.com>
1937 Revert fix of PR c++/44188
1938 * cp-tree.h (typedef_variant_p): Revert moving this declaration to
1940 * tree.c (typedef_variant_p): Revert moving this definition to
1942 * decl.c (grokdeclarator): Revert naming typedef handling.
1944 2010-05-27 Joseph Myers <joseph@codesourcery.com>
1946 * call.c: Include diagnostic-core.h instead of diagnostic.h.
1947 * cp-lang.c: Don't include diagnostic.h
1948 * name-lookup.c: Include diagnostic-core.h instead of
1950 (cp_emit_debug_info_for_using): Use seen_error.
1951 * optimize.c: Include diagnostic-core.h instead of diagnostic.h.
1952 * parser.c: Include diagnostic-core.h instead of diagnostic.h.
1953 * pt.c (iterative_hash_template_arg): Use seen_error.
1954 * repo.c: Include diagnostic-core.h instead of diagnostic.h.
1955 * typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
1956 * Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
1957 cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
1960 2010-05-25 Dodji Seketeli <dodji@redhat.com>
1963 * cp-tree.h (typedef_variant_p): Move this declaration to
1965 * tree.c (typedef_variant_p): Move this definition to gcc/tree.c.
1966 * decl.c (grokdeclarator): Do not rename debug info of an
1967 anonymous tagged type named by a typedef.
1969 2010-05-27 Jason Merrill <jason@redhat.com>
1972 * decl.c (grokdeclarator) [cdk_pointer et al]: Force evaluation of
1975 2010-05-27 Kai Tietz <kai.tietz@onevision.com>
1978 * rtti.c (emit_support_tinfos): Check for NULL_TREE.
1979 * class.c (layout_class_type): Likewise.
1980 * decl.c (finish_enum): Likewise.
1981 * mangle.c (write_builitin_type): Likewise.
1983 2010-05-26 Kai Tietz <kai.tietz@onevision.com>
1985 * cp-tree.h (cp_decl_specifier_seq): Add new bifield
1987 * decl.c (grokdeclarator): Handle __int128.
1988 * parser.c (cp_lexer_next_token_is_decl_specifier_ke): Likewise.
1989 (cp_parser_simple_type_specifier): Likewise.
1990 * rtti.c (emit_support_tinfos): Add int128 nodes for rtti.
1991 * typeck.c (cp_common_type): Handle __int128.
1992 * mangle.c (integer_type_codes): Add itk_int128 and
1993 itk_unsigned_int128.
1995 2010-05-26 Jason Merrill <jason@redhat.com>
1998 * pt.c (tsubst_pack_expansion): Don't get confused by recursive
2001 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2003 * cp-lang.c: Do not include expr.h.
2005 2010-05-26 Steven Bosscher <steven@gcc.gnu.org>
2007 * decl.c: Do not include rtl.h
2008 * semantics.c: Likewise.
2010 2010-05-25 Steven Bosscher <steven@gcc.gnu.org>
2012 * cp-tree.h: Do not include splay-tree.h.
2013 (struct prtmem_cst): Remove unused field and false comment.
2014 * typeck.c: Do not include rtl.h, expr.h, and tm_p.h.
2015 * optimize.c: Do not inclde rtl.h, insn-config.h, and integrate.h.
2016 * init.c: Do not include rtl.h and expr.h.
2017 * class.c: Do not include rtl.h. Include splay-tree.h.
2018 (build_clone): Use plain NULL instead of NULL_RTX.
2019 * decl.c: Do not include expr.h. Explain why rtl.h has to be
2020 included. Include splay-tree.h.
2021 * method.c: Do not include rtl.h and expr.h.
2022 (use_thunk): Use plain NULL instead of NULL_RTX.
2023 * except.c: Do not include rtl.h, expr.h, and libfuncs.h.
2024 * tree.c: Do not include rtl.h, insn-config.h, integrate.h,
2025 and target.h. Include splay-tree.h.
2026 * expr.c: Do not include rtl.h and expr.h.
2027 * pt.c: Do not include obstack.h and rtl.h.
2028 (tsubst_friend_function): Use plain NULL instead of NULL_RTX.
2029 (tsubst_decl): Likewise.
2030 (instantiate_decl): Likewise.
2031 * semantics.c: Do not include exprt.h and debug.h. Explain why
2032 rtl.h has to be included.
2033 * decl2.c: Do not include rtl.h and expr.h. Include splay-tree.h.
2034 * call.c: Do not include rtl.h and expr.h.
2035 * search.c: Do not include obstack.h and rtl.h.
2036 * friend.c: Do not include rtl.h and expr.h.
2037 * Make-lang.in: Update dependencies.
2039 2010-05-25 Jakub Jelinek <jakub@redhat.com>
2042 * parser.c (non_integral_constant): Add NIC_NONE.
2043 (required_token): Add RT_NONE.
2044 (cp_parser_unary_expression): Initialize non_constant_p
2046 (cp_parser_asm_definition): Initialize missing to RT_NONE.
2047 (cp_parser_primary_expression, cp_parser_postfix_expression,
2048 cp_parser_cast_expression, cp_parser_binary_expression,
2049 cp_parser_functional_cast): Fix formatting.
2051 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com>
2054 * parser.c: Remove inclusion of dyn-string.h.
2055 (non_integral_constant): New enum.
2056 (name_lookup_error): New enum.
2057 (required_token): New enum.
2058 (cp_parser_required_error): New function.
2059 (cp_parser_require): Change the type of variable token_desc to
2060 required_token and use cp_parser_required_error.
2061 (cp_parser_require_keyword): Likewise.
2062 (cp_parser_error): Use gmsgid as parameter.
2063 (cp_parser_name_lookup_error): Change the type of variable desired to
2064 name_lookup_error and put the diagnostic in the full sentences. Change
2066 (cp_parser_non_integral_constant_expression): Change the type of the
2067 variable thing to non_integral_constant and put the diagnostics in
2068 full sentences. Change caller.
2070 2010-05-24 Eric Botcazou <ebotcazou@adacore.com>
2073 * typeck.c (cp_build_unary_op): Fold offsetof-like computations.
2075 2010-05-24 Joseph Myers <joseph@codesourcery.com>
2077 * error.c (cp_diagnostic_starter): Update call to
2078 diagnostic_build_prefix.
2079 (cp_print_error_function,
2080 print_instantiation_partial_context_line): Check show_column flag
2083 2010-05-24 Jason Merrill <jason@redhat.com>
2086 * decl.c (check_initializer): Don't wrap an init-list in a
2088 * init.c (build_aggr_init): Don't assume copy-initialization if
2089 init has CONSTRUCTOR_IS_DIRECT_INIT.
2090 * call.c (build_new_method_call): Sanity check.
2092 2010-05-24 Nathan Froyd <froydnj@codesourcery.com>
2094 * rtti.c (tinfo_base_init): Use build_constructor instead of
2095 build_constructor_from_list. Don't cons a tree node for
2097 (generic_initializer): Use build_constructor_single instead of
2098 build_constructor_from_list.
2099 (ptr_initializer): Use build_constructor instead of
2100 build_constructor_from_list
2101 (ptm_initializer): Likewise.
2102 (class_initializer): Likewise. Take varargs instead of TRAIL.
2103 (get_pseudo_ti_init): Adjust calls to class_initializer. Use
2104 build_constructor instead of build_constructor_from_list.
2106 2010-05-22 Steven Bosscher <steven@gcc.gnu.org>
2108 * semantics.c: Include bitmap.h.
2109 * Make-lang.in: Update dependencies.
2111 2010-05-22 Jan Hubicka <jh@suse.cz>
2113 * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
2115 (cxx_callgraph_analyze_expr): Remove code marking vtables needed.
2117 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2119 * cxx-pretty-print.c: Correct merge error.
2121 2010-05-21 Joseph Myers <joseph@codesourcery.com>
2123 * error.c: Include tree-diagnostic.h and tree-pretty-print.h.
2124 (cp_print_error_function): Use diagnostic_abstract_origin macro.
2125 (cp_printer): Handle %K here using percent_K_format.
2126 * cxx-pretty-print.c: Include tree-pretty-print.h.
2127 * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
2130 2010-05-21 Steven Bosscher <steven@gcc.gnu.org>
2132 * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c:
2133 Clean up redundant includes.
2135 2010-05-20 Paolo Carlini <paolo.carlini@oracle.com>
2138 * decl.c (xref_basetypes): Return false in case of ill-formed
2141 2010-05-19 Jason Merrill <jason@redhat.com>
2143 * call.c (reference_binding): Use cp_build_qualified_type_real
2144 and cp_type_quals consistently.
2145 (add_function_candidate): Likewise.
2146 (build_conditional_expr): Likewise.
2147 (convert_like_real): Likewise.
2148 (type_passed_as): Likewise.
2149 * class.c (add_method): Likewise.
2150 (same_signature_p): Likewise.
2151 (layout_class_type): Likewise.
2152 * decl.c (cxx_init_decl_processing): Likewise.
2153 (cp_fname_init): Likewise.
2154 (grokdeclarator): Likewise.
2155 * decl2.c (cp_reconstruct_complex_type): Likewise.
2156 * init.c (build_new_1): Likewise.
2157 * method.c (do_build_copy_constructor): Likewise.
2158 (implicitly_declare_fn): Likewise.
2159 * pt.c (tsubst_aggr_type): Likewise.
2161 * rtti.c (init_rtti_processing): Likewise.
2162 (build_headof): Likewise.
2163 (build_dynamic_cast_1): Likewise.
2164 (tinfo_base_init): Likewise.
2165 (emit_support_tinfos): Likewise.
2166 * semantics.c (capture_decltype): Likewise.
2167 * tree.c (cv_unqualified): Likewise.
2168 * typeck.c (composite_pointer_type): Likewise.
2169 (string_conv_p): Likewise.
2171 * mangle.c (write_CV_qualifiers_for_type): Tweak.
2173 * call.c (initialize_reference): Use CP_TYPE_CONST_P.
2174 * decl.c (start_decl): Likewise.
2175 * semantics.c (finish_compound_literal): Likewise.
2176 * typeck.c (check_return_expr): Use CP_TYPE_VOLATILE_P.
2177 (cp_type_readonly): Remove.
2178 * cp-tree.h: Remove declaration.
2180 * typeck.c (merge_types): Preserve memfn quals.
2182 * decl.c (grokdeclarator): Don't check quals on fn type.
2183 * typeck.c (cp_apply_type_quals_to_decl): Likewise.
2184 * tree.c (cp_build_qualified_type_real): Simplify qualifier checking.
2187 * typeck.c (type_memfn_quals): New fn.
2188 (apply_memfn_quals): New fn.
2189 (cp_type_quals): Return TYPE_UNQUALIFIED for FUNCTION_TYPE.
2190 (cp_type_readonly): Use cp_type_quals.
2191 * cp-tree.h: Add declarations.
2192 * tree.c (cp_build_qualified_type_real): Don't set, but do
2193 preserve, quals on FUNCTION_TYPE.
2194 (strip_typedefs): Use apply_memfn_quals and type_memfn_quals.
2195 * decl.c (build_ptrmem_type): Likewise.
2196 (grokdeclarator): Likewise.
2197 (static_fn_type): Likewise.
2198 * decl2.c (change_return_type): Likewise.
2199 (cp_reconstruct_complex_type): Likewise.
2200 * pt.c (tsubst_function_type): Likewise.
2202 (tsubst): Likewise. Drop special FUNCTION_TYPE substitution code.
2204 2010-05-18 Nathan Froyd <froydnj@codesourcery.com>
2206 * tree.c (build_min_non_dep_call_vec): Update comment.
2208 2010-05-17 Jason Merrill <jason@redhat.com>
2210 * call.c (struct z_candidate): Add explicit_targs field.
2211 (add_template_candidate_real): Set it.
2212 (build_over_call): Use it to control init-list warning.
2215 * call.c (build_over_call): Limit init-list deduction warning to
2216 cases where the argument is actually an init-list.
2219 * call.c (build_over_call): Don't do bitwise copy for move ctor.
2221 2010-05-17 Dodji Seketeli <dodji@redhat.com>
2222 Jason Merrill <jason@redhat.com>
2225 * decl.c (compute_array_index_type): Call mark_rvalue_use.
2227 2010-05-15 Jason Merrill <jason@redhat.com>
2229 * cp-tree.h (TYPE_NOEXCEPT_P): New macro.
2230 * except.c (begin_eh_spec_block): Use MUST_NOT_THROW_EXPR if
2232 (finish_eh_spec_block): Adjust.
2234 2010-05-15 Jakub Jelinek <jakub@redhat.com>
2237 * pt.c (tsubst): Unshare template argument.
2239 2010-05-15 Steven Bosscher <steven@gcc.gnu.org>
2241 * decl.c: Include tree-iterator.h, as fixup for tree-inline.h changes.
2242 * Make-lang.in: Fix dependencies accordingly.
2244 2010-05-14 Jason Merrill <jason@redhat.com>
2247 * except.c (build_throw): Simplify, adjust for DR 475.
2250 * except.c (dtor_nothrow): Return nonzero for type with
2254 * cp-gimplify.c (gimplify_must_not_throw_expr): Use
2255 gimple_build_eh_must_not_throw.
2257 2010-05-14 Martin Jambor <mjambor@suse.cz>
2259 * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Remove both its undef
2262 2010-05-14 Jonathan Wakely <jwakely.gcc@gmail.com>
2264 * call.c (build_new_method_call): Change warning text.
2265 * typeck2.c (build_functional_cast): Change error text.
2267 2010-05-14 Shujing Zhao <pearly.zhao@oracle.com>
2270 * name-lookup.c (pushdecl_maybe_friend): Avoid the warnings about
2271 shadowing the outer parameter or variables by the declaration of
2272 nested function in nested structure or class. Warn the shadowing by
2273 the declaration of nested lambda expression.
2275 2010-05-13 Jason Merrill <jason@redhat.com>
2277 * typeck.c (cp_build_array_ref): Factor out from...
2278 (build_array_ref): ...here. Drop complain parm.
2279 (build_new_op): Adjust.
2280 * class.c (build_vtbl_ref_1): Adjust.
2281 * decl2.c (grok_array_decl): Adjust.
2282 * cp-tree.h: Adjust prototypes.
2284 2010-05-13 Jan Hubicka <jh@suse.cz>
2286 * decl.c (cp_finish_decl): Do not worry about used attribute.
2288 2010-05-12 Jason Merrill <jason@redhat.com>
2290 * typeck.c (build_array_ref): Take complain parm.
2291 * cp-tree.h: Add it to prototype.
2292 * call.c (build_new_op): Pass it.
2293 * class.c (build_vtbl_ref): Pass it.
2294 * decl2.c (grok_array_decl): Pass it.
2298 * cp-tree.def (NULLPTR_TYPE): Remove.
2299 * cp-tree.h (NULLPTR_TYPE_P): New.
2300 (SCALAR_TYPE_P): Use it.
2301 (nullptr_type_node): New.
2302 (cp_tree_index): Add CPTI_NULLPTR_TYPE.
2303 * decl.c (cxx_init_decl_processing): Call record_builtin_type on
2305 * cvt.c (ocp_convert): Use NULLPTR_TYPE_P instead of NULLPTR_TYPE.
2306 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2307 * error.c (dump_type, dump_type_prefix, dump_type_suffix): Likewise.
2308 * mangle.c (write_type): Likewise.
2309 * name-lookup.c (arg_assoc_type): Likewise.
2310 * typeck.c (build_reinterpret_cast_1): Likewise.
2311 * rtti.c (typeinfo_in_lib_p): Likewise.
2312 (emit_support_tinfos): Remove local nullptr_type_node.
2314 * cp-tree.h (UNKNOWN_TYPE): Remove.
2315 * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
2316 * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
2317 * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
2318 * class.c (instantiate_type): Check unknown_type_node rather than
2320 * name-lookup.c (maybe_push_decl): Likewise.
2321 * rtti.c (get_tinfo_decl_dynamic): Likewise.
2322 (get_typeid): Likewise.
2323 * semantics.c (finish_offsetof): Likewise.
2326 * call.c (add_template_candidate_real): If deduction fails, still
2327 add the template as a non-viable candidate.
2328 (equal_functions): Handle template candidates.
2329 (print_z_candidate): Likewise.
2330 (print_z_candidates): Likewise.
2331 (build_new_function_call): Likewise.
2333 * cp-tree.h (LOOKUP_LIST_ONLY): New.
2334 * call.c (add_candidates): Enforce it.
2335 (build_new_method_call): Try non-list ctor if no viable list ctor.
2336 (build_user_type_conversion_1): Likewise.
2338 * call.c (add_candidates): Distinguish between type(x) and
2340 (convert_class_to_reference): Set LOOKUP_NO_CONVERSION.
2341 (build_new_method_call): Give better error for conversion op.
2343 * call.c (add_candidates): Add first_arg and return_type parms.
2344 Add special constructor/conversion op handling.
2345 (convert_class_to_reference): Use it.
2346 (build_user_type_conversion_1): Likewise.
2347 (build_op_call): Likewise.
2348 (build_new_method_call): Likewise.
2349 (build_new_op): Adjust.
2350 (perform_overload_resolution): Adjust.
2352 2010-05-11 Paolo Carlini <paolo.carlini@oracle.com>
2357 * pt.c (process_partial_specialization): Return error_mark_node
2358 in case of unused template parameters in partial specialization.
2360 2010-05-11 Jakub Jelinek <jakub@redhat.com>
2363 * semantics.c (finish_expr_stmt): Don't call mark_exp_read here...
2364 * cvt.c (convert_to_void): ... but here. If expr is a COMPOUND_EXPR,
2365 look at its second operand.
2367 2010-05-10 Jason Merrill <jason@redhat.com>
2370 * semantics.c (baselink_for_fns): Revert earlier change.
2373 * typeck.c (cp_build_modify_expr): Complain about assignment to
2374 array from init list.
2376 2010-05-10 Fabien Chêne <fabien.chene@gmail.com>
2379 * decl.c (check_initializer): strip array type before checking for
2380 uninitialized const or ref members.
2382 2010-05-07 Fabien Chêne <fabien.chene@gmail.com>
2385 * init.c (diagnose_uninitialized_cst_or_ref_member_1): Returns the
2386 error count. Emit errors only if compain is true.
2387 (build_new_1): Do not return error_mark_node if
2388 diagnose_uninitialized_cst_or_ref_member_1 does not diagnose any
2389 errors. Delay the check for user-provided constructor.
2390 (perform_member_init): Adjust.
2391 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Change the
2394 2010-05-06 Magnus Fromreide <magfr@lysator.liu.se>
2395 Jason Merrill <jason@redhat.com>
2397 Add support for C++0x nullptr.
2398 * cp-tree.def: Add NULLPTR_TYPE.
2399 * cp-tree.h: Add nullptr_node.
2400 (cp_tree_index): Add CPTI_NULLPTR.
2401 (SCALAR_TYPE_P): Add NULLPTR_TYPE.
2402 * call.c (null_ptr_cst_p): Handle nullptr.
2403 (standard_conversion): Likewise.
2404 (convert_arg_to_ellipsis): Likewise.
2405 * mangle.c (write_type): Likewise.
2406 * name-lookup.c (arg_assoc_type): Likewise.
2407 * parser.c (cp_parser_primary_expression): Likewise.
2408 * typeck.c (cp_build_binary_op): Likewise.
2409 (build_reinterpret_cast_1): Likewise.
2410 * error.c (dump_type): Likewise.
2411 (dump_type_prefix, dump_type_suffix): Likewise.
2412 * decl.c (cxx_init_decl_processing): Likewise.
2413 * cxx-pretty-print.c (pp_cxx_constant): Likewise.
2414 * cvt.c (ocp_convert): Likewise.
2415 * rtti.c (typeinfo_in_lib_p, emit_support_tinfos): Put
2416 nullptr_t tinfo in libsupc++.
2418 2010-05-06 Jason Merrill <jason@redhat.com>
2420 * semantics.c (simplify_aggr_init_expr): Use INIT_EXPR.
2422 2010-04-22 Jakub Jelinek <jakub@redhat.com>
2423 Dodji Seketeli <dodji@redhat.com>
2426 * cp-tree.h (mark_exp_read, rvalue_use, lvalue_use, type_use):
2428 * expr.c (mark_exp_read, rvalue_use, lvalue_use, type_use): ... new fns.
2429 * typeck.c (cxx_sizeof_expr, cxx_alignof_expr): Call type_use.
2430 (decay_conversion, perform_integral_promotions): Call rvalue_use.
2431 (cp_build_unary_op): Call lvalue_use.
2432 * decl.c (unused_but_set_errorcount): New variable.
2433 (poplevel): Issue -Wunused-but-set-variable diagnostics.
2434 (duplicate_decls): Merge DECL_READ_P flags.
2435 (start_cleanup_fn): Set DECL_READ_P flag.
2436 (finish_function): Issue -Wunused-but-set-parameter diagnostics.
2437 * tree.c (rvalue): Call rvalue_use.
2438 * pt.c (convert_nontype_argument): Likewise.
2439 * semantics.c (finish_expr_stmt, finish_asm_stmt, finish_typeof,
2440 finish_decltype_type): Likewise.
2441 * call.c (convert_like_real) <ck_identity, ck_user>: Call rvalue use.
2442 (build_x_va_arg, build_new_method_call, build_over_call): Call lvalue_use
2443 or rvalue_use depending on the expr.
2444 * init.c (build_new, build_delete): Likewise.
2445 * rtti.c (build_typeid, build_dynamic_cast_1): Likewise.
2447 2010-05-05 Jason Merrill <jason@redhat.com>
2450 * cp-gimplify.c (cp_gimplify_expr): Remove copies of empty classes.
2451 * call.c (build_over_call): Don't try to avoid INIT_EXPR copies here.
2453 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2456 * pt.c (unify): Check each elt for error_mark_node.
2458 2010-05-04 Jason Merrill <jason@redhat.com>
2461 * typeck.c (cp_build_binary_op): Allow enums for <> as well.
2463 2010-05-04 Paolo Carlini <paolo.carlini@oracle.com>
2466 * call.c (build_new_method_call): Return error_mark_node if fns is
2469 2010-05-03 Dodji Seketeli <dodji@redhat.com>
2472 * pt.c (most_specialized_class): Pretend we are processing
2473 a template decl during the call to coerce_template_parms.
2475 2010-05-03 Jason Merrill <jason@redhat.com>
2479 * decl.c (finish_enum): Use the TYPE_MIN_VALUE and TYPE_MAX_VALUE
2480 from the selected underlying type unless -fstrict-enums. Set
2481 ENUM_UNDERLYING_TYPE to have the restricted range.
2482 * cvt.c (type_promotes_to): Use ENUM_UNDERLYING_TYPE.
2483 * class.c (check_bitfield_decl): Likewise.
2485 2010-05-01 H.J. Lu <hongjiu.lu@intel.com>
2488 * init.c (build_new_1): Revert the accidental checkin in
2491 2010-04-30 Jason Merrill <jason@redhat.com>
2494 * cxx-pretty-print.c (pp_cxx_decl_specifier_seq): Move pmf handling...
2495 (pp_cxx_type_specifier_seq): ...here.
2497 2010-04-30 Steven Bosscher <steven@gcc.gnu.org>
2499 * optimize.c, parser.c, mangle.c, cp-tree.h: Do not include varray.h.
2500 * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H.
2502 2010-04-30 Shujing Zhao <pearly.zhao@oracle.com>
2505 * typeck.c (warn_args_num): New function.
2506 (convert_arguments): Use warn_args_num to print the diagnostic
2509 2010-04-29 Fabien Chêne <fabien.chene@gmail.com>
2512 * init.c (diagnose_uninitialized_cst_or_ref_member): check for
2513 user-provided constructor while recursing.
2515 2010-04-28 Manuel López-Ibáñez <manu@gcc.gnu.org>
2518 * error.c (print_instantiation_partial_context_line): Handle
2519 recursive instantiation.
2520 (print_instantiation_partial_context): Likewise.
2522 2010-04-27 Jason Merrill <jason@redhat.com>
2524 * init.c (perform_member_init): Check CLASS_TYPE_P.
2526 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2529 * init.c (perform_member_init): check for uninitialized const or
2530 reference members, including array types.
2532 2010-04-24 Jason Merrill <jason@redhat.com>
2534 * tree.c (get_fns): Split out from get_first_fn.
2535 * cp-tree.h: Declare it.
2536 * search.c (shared_member_p): Use it.
2537 * semantics.c (finish_qualified_id_expr): Simplify.
2538 (finish_id_expression): Simplify.
2540 * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
2541 whenever object is NULL_TREE. Don't do 'this' capture here.
2542 (finish_qualified_id_expr): Pass NULL_TREE.
2543 (finish_id_expression): Likewise.
2544 (lambda_expr_this_capture): Likewise.
2546 * semantics.c (finish_qualified_id_expr): Use maybe_dummy_object
2547 rather than checking current_class_ref directly.
2548 (finish_call_expr): Likewise.
2551 * name-lookup.c (qualify_lookup): Disqualify lambda op().
2552 * class.c (current_nonlambda_class_type): New fn.
2553 * semantics.c (nonlambda_method_basetype): New.
2554 * cp-tree.h: Declare them.
2555 * tree.c (maybe_dummy_object): Handle implicit 'this' capture.
2557 * semantics.c (baselink_for_fns): Correct BASELINK_BINFO.
2560 * semantics.c (lambda_return_type): Complain about
2564 * tree.c (cv_unqualified): Handle error_mark_node.
2567 * call.c (convert_like_real) [ck_ambig]: Just return error_mark_node
2568 if we don't want errors.
2571 * class.c (convert_to_base): Add complain parameter. Pass
2572 ba_quiet to lookup_base if we don't want errors.
2573 (build_vfield_ref): Pass complain to convert_to_base.
2574 * call.c (convert_like_real): Likewise.
2575 (initialize_reference): Likewise.
2576 (perform_direct_initialization_if_possible): Pass complain to
2578 * cp-tree.h: Adjust.
2580 2010-04-27 Fabien Chêne <fabien.chene@gmail.com>
2581 Jason Merrill <jason@redhat.com>
2584 * decl.c (check_for_uninitialized_const_var): Handle classes that need
2586 (check_initializer): Call it for classes that need constructing, too.
2587 * class.c (in_class_defaulted_default_constructor): New.
2588 * cp-tree.h: Declare it.
2590 2010-04-20 Jason Merrill <jason@redhat.com>
2593 * init.c (constant_value_1): Treat error_mark_node as a constant
2594 if DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P is set.
2595 * cvt.c (ocp_convert): Handle getting error_mark_node from
2596 integral_constant_value.
2597 * decl.c (compute_array_index_type): Likewise.
2599 2010-04-20 Dodji Seketeli <dodji@redhat.com>
2603 * typeck.c (incompatible_dependent_types_p): If one of the
2604 compared types if not a typedef then honour their main variant
2607 2010-04-20 Jakub Jelinek <jakub@redhat.com>
2609 * cp-tree.h (TYPE_REF_IS_RVALUE): Remove.
2611 2010-04-19 Dodji Seketeli <dodji@redhat.com>
2614 * typeck.c (structural_comptypes): Test dependent typedefs
2615 incompatibility before testing for their main variant based
2618 2010-04-19 Jakub Jelinek <jakub@redhat.com>
2620 * cp-tree.h (SCOPED_ENUM_P, UNSCOPED_ENUM_P, SET_SCOPED_ENUM_P): Use
2621 ENUM_IS_SCOPED bit instead of TYPE_LANG_FLAG_5.
2623 2010-04-18 Eric Botcazou <ebotcazou@adacore.com>
2625 * decl.c (cxx_init_decl_processing): Remove second argument in call to
2626 build_common_tree_nodes.
2628 2010-04-14 Jason Merrill <jason@redhat.com>
2631 * parser.c (cp_parser_parenthesized_expression_list): Change
2632 is_attribute_list parm to int to indicate whether or not to
2633 handle initial identifier specially.
2634 (cp_parser_attribute_list): Use attribute_takes_identifier_p.
2636 2010-04-13 Jason Merrill <jason@redhat.com>
2638 * call.c (type_decays_to): Check MAYBE_CLASS_TYPE_P instead of
2640 * parser.c (cp_parser_lambda_expression): Complain about lambda in
2641 unevaluated context.
2642 * pt.c (iterative_hash_template_arg): Don't crash on lambda.
2644 2010-04-12 Jason Merrill <jason@redhat.com>
2647 * semantics.c (maybe_add_lambda_conv_op): Use build_call_a and tweak
2648 return value directly.
2650 * call.c (type_decays_to): Call cv_unqualified for non-class type.
2652 2010-04-12 Fabien Chene <fabien.chene@gmail.com>
2655 * cp-tree.h (diagnose_uninitialized_cst_or_ref_member): Declare.
2656 * init.c (build_new_1): Check for uninitialized const members and
2657 uninitialized reference members, when using new without
2658 new-initializer. Call diagnose_uninitialized_cst_or_ref_member.
2659 (diagnose_uninitialized_cst_or_ref_member): Define, call
2660 diagnose_uninitialized_cst_or_ref_member_1.
2661 (diagnose_uninitialized_cst_or_ref_member_1): New function.
2663 2010-04-12 Richard Guenther <rguenther@suse.de>
2666 * semantics.c (expand_or_defer_fn_1): Do not keep extern
2667 template inline functions.
2669 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
2672 * typeck.c (cp_build_c_cast): Warn for casting integer to larger
2675 2010-04-07 Jason Merrill <jason@redhat.com>
2678 * decl.c (start_preparsed_function): Do defer nested functions.
2680 PR c++/11094, DR 408
2681 * cp-tree.h (VAR_HAD_UNKNOWN_BOUND, SET_VAR_HAD_UNKNOWN_BOUND): New.
2682 * decl2.c (finish_static_data_member_decl): Set it.
2683 * decl.c (duplicate_decls): Propagate it.
2684 * pt.c (tsubst_decl): Don't substitute the domain of an array
2685 VAR_DECL if it's set.
2686 (regenerate_decl_from_template): Substitute it here.
2687 (type_dependent_expression_p): Return true if it's set.
2688 * semantics.c (finish_decltype_type): Instantiate such a variable.
2689 * typeck.c (cxx_sizeof_expr): Likewise.
2690 (strip_array_domain): New.
2693 * name-lookup.c (current_decl_namespace): Non-static.
2694 (pop_nested_namespace): Sanity check.
2695 * cp-tree.h: Declare current_decl_namespace.
2696 * decl.c (grokvardecl): Use it instead of current_namespace.
2697 (grokfndecl): Likewise.
2700 * pt.c (tsubst_friend_function): Instatiate a friend that has already
2703 * pt.c (print_template_statistics): New.
2704 * cp-tree.h: Declare it.
2705 * tree.c (cxx_print_statistics): Call it.
2708 * decl.c (grokvardecl): Tweak warning message.
2709 (grokfndecl): Likewise.
2711 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2714 *pt.c (tsubst_decl): Get the arguments of a specialization from
2715 the specialization template, not from the most general template.
2717 2010-04-07 Dodji Seketeli <dodji@redhat.com>
2720 * typeck2.c (process_init_constructor_record):
2721 value-initialize members that are are not explicitely
2724 2010-04-07 Jie Zhang <jie@codesourcery.com>
2727 * typeck2.c (split_nonconstant_init_1): Drop empty CONSTRUCTOR
2728 when all of its elements are non-constant and have been split out.
2730 2010-04-06 Taras Glek <taras@mozilla.com>
2731 Jason Merrill <jason@redhat.com>
2733 * parser.c (cp_parser_class_specifier): Set class location to that
2734 of IDENTIFIER_NODE instead of '{' when possible.
2735 * semantics.c (begin_class_definition): Do not overide locations
2736 with less precise ones.
2738 2010-04-06 Jason Merrill <jason@redhat.com>
2741 * name-lookup.c (constructor_name_p): Allow X::~X even for typedefs.
2744 * pt.c (maybe_update_decl_type): Check the return value from
2747 2010-04-01 Jason Merrill <jason@redhat.com>
2749 * decl.c (next_initializable_field): No longer static.
2750 * cp-tree.h: Declare it.
2751 * call.c (build_aggr_conv): Fail if there are more initializers
2752 than initializable fields.
2754 * semantics.c (maybe_add_lambda_conv_op): Use null_pointer_node
2755 instead of void_zero_node.
2757 2010-03-31 Dodji Seketeli <dodji@redhat.com>
2760 * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): New accessor macro.
2761 * pt.c (end_template_parm_list): Store sibling template parms of
2762 each TEMPLATE_TYPE_PARMs into its TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2763 (push_template_decl_real): Don't store the containing template decl
2764 into the DECL_CONTEXT of TEMPLATE_TYPE_PARMs anymore.
2765 * typeck.c (get_template_parms_of_dependent_type): Get sibling parms
2766 of a TEMPLATE_TYPE_PARM from TEMPLATE_TYPE_PARM_SIBLING_PARMS.
2769 2010-03-30 Jason Merrill <jason@redhat.com>
2772 * pt.c (push_template_decl_real): Deal better with running out of
2773 scopes before running out of template parms.
2777 * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
2778 function parameter context. Don't print an error if parsing
2782 * pt.c (more_specialized_fn): Don't control cv-qualifier check
2785 2010-03-26 Jason Merrill <jason@redhat.com>
2788 * parser.c (cp_parser_qualifying_entity): Do accept enum names in
2789 c++0x mode, but not other type-names.
2791 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2794 * pt.c (add_to_template_args): Support NULL ARGS;
2795 (most_specialized_class): call coerce_template_parms on
2796 template arguments passed to get_class_bindings. Use
2797 add_to_template_args.
2798 (unify): Handle VAR_DECLs.
2800 2010-03-26 Dodji Seketeli <dodji@redhat.com>
2802 * cp-tree.h (get_template_parms_at_level): Change unsigned parm
2804 * pt.c (get_template_parms_at_level): Adjust.
2806 2010-03-25 Dodji Seketeli <dodji@redhat.com>
2809 * cp-tree.h (get_template_parms_at_level): Declare ...
2810 * pt.c (get_template_parms_at_level): ... new function.
2811 * typeck.c (get_template_parms_of_dependent_type): If a template
2812 type parm's DECL_CONTEXT isn't yet set, get its siblings from
2813 current_template_parms. Use get_template_parms_at_level. Remove
2815 (incompatible_dependent_types_p): If we get empty parms from just one
2816 of the template type parms we are comparing then the template parms are
2819 2010-03-24 Jason Merrill <jason@redhat.com>
2822 * parser.c (make_declarator): Initialize id_loc.
2823 (cp_parser_lambda_declarator_opt): And set it.
2825 2010-03-23 Jason Merrill <jason@redhat.com>
2827 Make lambda conversion op and op() non-static.
2828 * semantics.c (maybe_add_lambda_conv_op): Make non-static.
2829 Also add the thunk function returned by the conversion op.
2830 Mark the conversion deleted if the op() is variadic.
2831 * decl2.c (mark_used): Give helpful message about deleted conversion.
2832 * parser.c (cp_parser_lambda_declarator_opt): Don't make op() static.
2833 * semantics.c (finish_this_expr): Adjust.
2834 * mangle.c (write_closure_type_name): Adjust.
2835 * decl.c (grok_op_properties): Don't allow it.
2836 * call.c (build_user_type_conversion_1): No static conversion ops.
2837 (build_op_call): Or op().
2839 * decl2.c (change_return_type): Fix 'this' quals.
2841 2010-03-22 Jason Merrill <jason@redhat.com>
2844 * tree.c (pod_type_p): Use old meaning in C++98 mode.
2847 * pt.c (contains_auto_r): New fn.
2848 (do_auto_deduction): Use it.
2849 (tsubst): Don't look at TREE_TYPE of a TEMPLATE_TYPE_PARM.
2851 2010-03-20 Simon Martin <simartin@users.sourceforge.net>
2854 * decl2.c (grokfield): Handle invalid initializers for member
2857 2010-03-20 Dodji Seketeli <dodji@redhat.com>
2860 * method.c (make_alias_for): Avoid crashing when DECL_LANG_SPECIFIC
2862 * decl2.c (vague_linkage_p): Likewise.
2864 2010-03-18 Paolo Carlini <paolo.carlini@oracle.com>
2867 * parser.c (cp_parser_for_init_statement): Use NULL_TREE, not
2868 false, in the cp_parser_expression_statement call.
2870 2010-03-05 Jason Merrill <jason@redhat.com>
2872 * mangle.c (mangle_decl): Give name collision error even without
2875 2010-03-04 Marco Poletti <poletti.marco@gmail.com>
2877 * pt.c (process_partial_specialization): Use error_n instead of
2880 2010-03-03 Jason Merrill <jason@redhat.com>
2883 * mangle.c (mangle_decl): Handle VAR_DECL, too.
2885 2010-03-03 Jason Merrill <jason@redhat.com>
2888 * mangle.c: Include cgraph.h.
2889 (mangle_decl): If the mangled name will change in a later
2890 ABI version, make the later mangled name an alias.
2891 * method.c (make_alias_for): Copy DECL_ARGUMENTS.
2892 * Make-lang.in (mangle.o): Depend on cgraph.h.
2893 * method.c (make_alias_for): Handle VAR_DECL, too.
2894 * decl2.c (vague_linkage_p): Rename from vague_linkage_fn_p.
2895 * tree.c (no_linkage_check): Adjust.
2896 * decl.c (maybe_commonize_var): Adjust.
2897 * cp-tree.h: Adjust.
2899 2010-03-01 Marco Poletti <poletti.marco@gmail.com>
2901 * pt.c (redeclare_class_template): Use error_n and inform_n.
2903 2010-02-27 Mark Mitchell <mark@codesourcery.com>
2906 * cp-tree.h (push_tinst_level): Declare.
2907 (pop_tinst_level): Likewise.
2908 * pt.c (push_tinst_level): Give it external linkage.
2909 (pop_tinst_level): Likewise.
2910 * mangle.c (mangle_decl_string): Set the source location to that
2911 of the decl while mangling.
2913 2010-02-27 Simon Martin <simartin@users.sourceforge.net>
2916 * pt.c (redeclare_class_template): Return false if there are erroneous
2917 template parameters.
2919 2010-02-24 Manuel López-Ibáñez <manu@gcc.gnu.org>
2921 * pt.c (push_tinst_level): Replace -ftemplate-depth- with
2924 2010-02-24 Jason Merrill <jason@redhat.com>
2927 * mangle.c (write_type): Give -Wabi warning for old vector mangling.
2929 * class.c (layout_class_type): Don't give -Wabi warning for a bug
2930 in a previous ABI version.
2932 2010-02-23 Jason Merrill <jason@redhat.com>
2935 * typeck2.c (digest_init_r): Accept value init of array.
2937 2010-02-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
2940 * typeck.c (convert_arguments): Update error message.
2942 2010-02-22 Mike Stump <mikestump@comcast.net>
2945 * decl.c (duplicate_decls): Merge DECL_PRESERVE_P.
2947 2010-02-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
2950 * error.c (print_instantiation_partial_context_line): New.
2951 (print_instantiation_partial_context): Print at most 12 contexts,
2952 skip the rest with a message.
2954 2010-02-21 Dodji Seketeli <dodji@redhat.com>
2957 * pt.c (lookup_template_class): Better support of specialization
2958 of member of class template implicit instantiation.
2960 2010-02-20 Manuel López-Ibáñez <manu@gcc.gnu.org>
2963 * call.c (conversion_null_warnings): Replace -Wconversion with
2965 * cvt.c (build_expr_type_conversion): Likewise.
2967 2010-02-18 Jason Merrill <jason@redhat.com>
2970 * class.c (create_vtable_ptr): Set DECL_PACKED if type is packed.
2973 * typeck.c (cp_build_binary_op): Adapt mixed complex/non handling from
2975 * cp-tree.h (WANT_VECTOR_OR_COMPLEX): Rename from WANT_VECTOR.
2976 * cvt.c (build_expr_type_conversion): Allow COMPLEX_TYPE.
2979 * semantics.c (finish_goto_stmt): Don't call decay_conversion.
2983 * pt.c (tsubst_qualified_id): Do normal lookup in non-dependent scope.
2984 (maybe_update_decl_type): New fn.
2985 * parser.c (cp_parser_init_declarator): Use it.
2988 * semantics.c (begin_class_definition): Don't crash on unnamed ns.
2990 2010-02-17 Jason Merrill <jason@redhat.com>
2993 * call.c (build_over_call): Don't create zero-sized assignments.
2994 * cp-gimplify.c (cp_genericize_r): Don't remove them here.
2995 * cp-objcp-common.c (cp_expr_size): Remove.
2996 * cp-tree.h: Remove prototype.
2999 * name-lookup.c (set_decl_namespace): Don't copy DECL_CONTEXT if the
3000 decl we looked up doesn't match.
3003 * cp-gimplify.c (cp_gimplify_expr) [INIT_EXPR]: Return if we don't
3004 have an INIT_EXPR anymore.
3007 * pt.c (convert_nontype_argument): Change assert to test.
3009 2010-02-16 Jason Merrill <jason@redhat.com>
3011 * cp-gimplify.c (cp_gimplify_expr): Fix error recovery.
3014 * cp-gimplify.c (cp_gimplify_expr) [MODIFY_EXPR]: Use
3015 VIEW_CONVERT_EXPR for conversions between structural equality types
3016 that the back end can't tell are the same.
3019 * tree.c (build_cplus_array_type): Set TYPE_MAIN_VARIANT to strip
3020 cv-quals from element here.
3021 (cp_build_qualified_type_real): Not here. Preserve typedef name.
3023 2010-02-14 Jason Merrill <jason@redhat.com>
3026 * semantics.c (finish_compound_literal): Use
3027 cp_apply_type_quals_to_decl when creating a static variable.
3029 2010-02-12 Jason Merrill <jason@redhat.com>
3032 * name-lookup.h (current_binding_level): Check for null
3035 2010-02-12 Jason Merrill <jason@redhat.com>
3038 * tree.c (cp_tree_equal): Correct CALL_EXPR logic.
3040 2010-02-12 Jakub Jelinek <jakub@redhat.com>
3043 * name-lookup.c (pushdecl_maybe_friend): Check default args of t
3046 2010-02-10 Jason Merrill <jason@redhat.com>
3049 * semantics.c (outer_lambda_capture_p): Revert.
3050 (add_capture): Only finish_member_declaration if
3051 we're in the lambda class.
3052 (register_capture_members): New.
3053 * cp-tree.h: Declare it.
3054 * parser.c (cp_parser_lambda_expression): Call it.
3056 2010-02-10 Jason Merrill <jason@redhat.com>
3059 * semantics.c (outer_lambda_capture_p): Use current_function_decl
3060 instead of current_class_type.
3062 2010-02-10 Jason Merrill <jason@redhat.com>
3064 PR c++/42983, core issue 906
3065 * method.c (defaultable_fn_check): Check virtualness.
3067 2010-02-10 Jason Merrill <jason@redhat.com>
3070 * semantics.c (maybe_add_lambda_conv_op): Set DECL_INTERFACE_KNOWN.
3072 2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
3074 * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
3075 * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
3077 * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
3078 (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
3079 (cp_parser_parameter_declaration)
3080 (cp_parser_exception_specification_opt)
3081 (cp_parser_exception_declaration): Likewise.
3082 * pt.c (check_default_tmpl_args): Likewise.
3083 * search.c (lookup_field_r): Likewise.
3085 2010-02-09 Jason Merrill <jason@redhat.com>
3088 * pt.c (tsubst_copy_and_build): Propagate LAMBDA_EXPR_LOCATION.
3090 2010-02-09 Jason Merrill <jason@redhat.com>
3093 * decl2.c (change_return_type): New fn.
3094 * semantics.c (apply_lambda_return_type): Use it.
3095 * cp-tree.h: Declare it.
3097 2010-02-05 Richard Guenther <rguenther@suse.de>
3099 * Make-lang.in (cp/cp-lang.o): Depend on gt-cp-cp-lang.h.
3100 * cp-lang.c: Include gt-cp-cp-lang.h.
3101 * config-lang.in (gtfiles): Add cp/cp-lang.c.
3103 2010-02-05 Dodji Seketeli <dodji@redhat.com>
3106 * typeck.c (get_template_parms_of_dependent_type): Try getting
3107 the template parameters fromt the type itself first.
3109 2010-02-03 Jason Merrill <jason@redhat.com>
3113 * mangle.c (write_unqualified_id): Split out from write_expression.
3114 (write_unqualified_name): Call it.
3115 (write_member_name): Likewise.
3116 (write_expression): Support TEMPLATE_ID_EXPR.
3117 Disambiguate operator names.
3120 * mangle.c (write_type) [VECTOR_TYPE]: Change mangling with
3123 2010-02-02 Jason Merrill <jason@redhat.com>
3126 * decl.c (cp_finish_decl): Add local statics to cfun->local_decls.
3127 * optimize.c (clone_body): Remap their initializers when making base
3129 (maybe_clone_body): Complain if multiple clones aren't safe.
3131 2010-01-29 Dodji Seketeli <dodji@redhat.com>
3138 * cp-tree.h (NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3139 SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT,
3140 GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT): New accessor macros.
3141 * pt.c (coerce_template_parms, type_unification_real,
3142 expand_template_argument_pack, coerce_template_parameter_pack):
3143 Set the non default template args count.
3144 (current_template_args): Always set non defaulted
3145 template args count when compiled with --enable-checking
3146 (tsubst_template_args, type_unification_real): Propagate the non
3147 defaulted template args count.
3148 * error.c (get_non_default_template_args_count): Renamed
3149 count_non_default_template_args into this. Don't calculate the
3150 non default template argument count anymore. Use the new
3151 accessor macros above to get it.
3152 (dump_template_argument_list, dump_type, dump_decl,
3153 dump_template_parms): Adjust.
3154 * parser.c (cp_parser_template_argument_list): Always set defaulted
3155 template args count when compiled with --enable-checking.
3157 2010-01-29 Shujing Zhao <pearly.zhao@oracle.com>
3159 * decl.c (redeclaration_error_message): Wrap the return messages into
3160 G_() for easy translation.
3162 2010-01-28 Jason Merrill <jason@redhat.com>
3165 * semantics.c (begin_class_definition): Don't use type_as_string.
3167 2010-01-28 Dodji Seketeli <dodji@redhat.com>
3171 * typeck.c (get_template_parms_of_dependent_type): Factorized
3172 this out of incompatible_template_type_parms_p
3173 (incompatible_dependent_types_p): Renamed
3174 incompatible_template_type_parms_p into this. Make it detect
3175 two incompatible dependent typedefs too.
3176 (structural_comptypes): Use incompatible_dependent_types_p.
3177 * pt.c (get_template_info):
3178 Handle BOUND_TEMPLATE_TEMPLATE_PARAM.
3180 2010-01-20 Janis Johnson <janis187@us.ibm.com>
3181 Jason Merrill <jason@redhat.com>
3183 * mangle.c (write_type): Mangle transparent record as member type.
3184 * semantics.c (begin_class_definition): Recognize decimal classes
3185 and set TYPE_TRANSPARENT_AGGR.
3187 2010-01-20 Jason Merrill <jason@redhat.com>
3190 * mangle.c (write_expression): Handle tree codes that have extra
3191 arguments in the middle-end.
3193 2010-01-20 Paolo Carlini <paolo.carlini@oracle.com>
3196 * except.c (expand_start_catch_block): Deal correctly with
3197 do_begin_catch returning error_mark_node.
3199 2010-01-20 Jason Merrill <jason@redhat.com>
3202 * class.c (layout_class_type): Set packed_maybe_necessary for packed
3206 * semantics.c (build_lambda_object): Call mark_used on captured
3210 * decl.c (grokdeclarator): Clear type_quals for a member function
3211 declared using a typedef. Don't complain about adding cv-quals
3212 to a function typedef in C++0x mode.
3214 2010-01-20 Jakub Jelinek <jakub@redhat.com>
3216 * decl.c (create_array_type_for_decl): Remove set but not used
3217 variable error_msg. Remove break stmts after return stmts.
3219 2010-01-19 Dodji Seketeli <dodji@redhat.com>
3221 * error.c (dump_template_parms, count_non_default_template_args):
3222 Revert fix of PR c++/42634.
3224 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3227 * error.c (dump_template_parms): Use innermost template
3228 arguments before calling count_non_default_template_args.
3229 (count_non_default_template_args): We are being called with
3230 template innermost arguments now. There is no need to ensure
3233 2010-01-18 Dodji Seketeli <dodji@redhat.com>
3236 * cvt.c (build_expr_type_conversion): Look through OVERLOAD.
3238 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3241 *pt.c (tsubst_decl): Revert commit for PR c++/42697.
3243 2010-01-17 Dodji Seketeli <dodji@redhat.com>
3246 *pt.c (tsubst_decl): Get the arguments of a specialization from
3247 the specialization template, not from the most general template.
3249 2010-01-16 Jason Merrill <jason@redhat.com>
3252 * semantics.c (finish_decltype_type): Within a template, treat
3253 unresolved CALL_EXPR as dependent.
3255 2010-01-15 Dodji Seketeli <dodji@redhat.com>
3257 * error.c (dump_template_parms,count_non_default_template_args):
3258 Revert changes of PR c++/42634.
3260 2010-01-14 Jakub Jelinek <jakub@redhat.com>
3263 * decl.c (finish_function): Don't emit -Wreturn-type warnings in
3264 functions with noreturn attribute.
3266 2010-01-14 Jason Merrill <jason@redhat.com>
3269 * call.c (build_new_method_call): Don't free the vec here.
3272 * call.c (convert_like_real): Do full decay_conversion for ck_rvalue.
3274 2010-01-13 Dodji Seketeli <dodji@redhat.com>
3277 * error.c (dump_template_parms): Use innermost template
3278 arguments before calling count_non_default_template_args.
3279 (count_non_default_template_args): We are being called with
3280 template innermost arguments now. There is no need to ensure
3283 2010-01-07 Dodji Seketeli <dodji@redhat.com>
3286 * pt.c (unify_pack_expansion): In non-deduced contexts, re-use template
3287 arguments that were previously deduced.
3289 2010-01-05 Jason Merrill <jason@redhat.com>
3291 * pt.c (unify_pack_expansion): Handle deduction from init-list.
3292 * call.c (build_over_call): Don't complain about it.
3294 2010-01-04 Jason Merrill <jason@redhat.com>
3297 * pt.c (tsubst_decl): Don't apply type attributes in place.
3300 * semantics.c (describable_type): Remove decltype comment and
3305 Copyright (C) 2010 Free Software Foundation, Inc.
3307 Copying and distribution of this file, with or without modification,
3308 are permitted in any medium without royalty provided the copyright
3309 notice and this notice are preserved.