1 2009-10-14 Jason Merrill <jason@redhat.com>
4 * call.c (print_z_candidates): Don't print deleted candidates.
5 (print_z_candidate): Note deleted candidates.
7 2009-10-14 Larry Evans <cppljevans@suddenlink.net>
10 * tree.c (cp_tree_equal): Add test for TEMPLATE_PARM_PARAMETER_PACK
13 2009-10-12 Jason Merrill <jason@redhat.com>
16 * parser.c (cp_parser_decltype): Set greater_than_is_operator_p.
19 * pt.c (type_unification_real): Call convert_template_argument
20 for function default template arguments.
21 (check_default_tmpl_args): Suggest -std=c++0x when function default
22 template args seen in C++98 mode.
24 2009-10-11 Jason Merrill <jason@redhat.com>
27 * typeck.c (build_reinterpret_cast_1): Handle rvalue refs
30 2009-10-11 Richard Guenther <rguenther@suse.de>
32 * tree.c (cp_free_lang_data): Drop anonymous aggregate names.
34 2009-10-08 Jason Merrill <jason@redhat.com>
37 * pt.c (maybe_adjust_types_for_deduction): Do rvalue ref adjustment
38 even when DEDUCE_EXACT.
41 * pt.c (resolve_nondeduced_context): New.
42 * cvt.c (convert_to_void): Call it.
43 * semantics.c (finish_decltype_type): Likewise.
44 * typeck.c (decay_conversion): Here too.
45 * pt.c (tsubst_decl): Don't clobber input_location.
46 Don't register a bad specialization.
48 2009-10-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
50 * cp-tree.h: Fix location of documentation for DECL_LANG_FLAG_7.
52 2009-10-07 Jason Merrill <jason@redhat.com>
55 * pt.c (tsubst_pack_expansion): Don't do anything now if we
56 have incomplete packs of different lengths.
59 * tree.c (build_qualified_name): Call convert_from_reference.
61 2009-10-06 Jason Merrill <jason@redhat.com>
63 Fix lookup of initialized captures in unevaluated context.
64 * cp-tree.h (DECL_NORMAL_CAPTURE_P): New.
65 * name-lookup.c (qualify_lookup): Check it.
66 * parser.c (cp_parser_lambda_introducer): Pass explicit_init_p
68 * semantics.c (add_capture): Set DECL_NORMAL_CAPTURE_P
69 on captures without explicit init.
70 (add_default_capture): Pass explicit_init_p.
72 Fix capture by copy of types with explicit copy constructor.
73 * cp-tree.h (TARGET_EXPR_DIRECT_INIT_P): New.
74 (DIRECT_INIT_EXPR_P): New.
75 * typeck.c (convert_for_initialization): Just return if
77 * semantics.c (build_lambda_object): Use
78 TARGET_EXPR_DIRECT_INIT_P for normal captures.
80 2009-10-05 Jason Merrill <jason@redhat.com>
82 * parser.c: Mark lambda_scope and lambda_count for PCH.
84 2009-10-03 Jason Merrill <jason@redhat.com>
87 * parser.c (cp_parser_lambda_introducer): Avoid infinite loop on
90 2009-10-02 Jason Merrill <jason@redhat.com>
92 * mangle.c (write_unnamed_type_name): Implement.
93 (local_class_index): Split out from...
94 (discriminator_for_local_entity): ...here.
95 (nested_anon_class_index): New.
96 * cp-tree.h (TYPE_FUNCTION_SCOPE_P): New.
98 2009-10-02 Janis Johnson <janis187@us.ibm.com>
100 * call.c (convert_arg_to_ellipsis): Avoid promoting decimal32
103 2009-10-01 Jason Merrill <jason@redhat.com>
105 * parser.c (cp_parser_lambda_expression): Compute visibility.
106 (no_linkage_lambda_type_p): Remove.
107 * cp-tree.h: Remove declaration.
108 * tree.c (no_linkage_check): Don't call it. Don't check template
109 args. Don't check TREE_PUBLIC Types.
111 2009-10-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
112 Jason Merrill <jason@redhat.com>
114 * decl.c (grokdeclarator): Set constexprness before announcing
117 2009-10-01 Gabriel Dos Reis <gdr@cs.tamu.edu>
119 * decl.c (record_builtin_java_type): Undo unintended change.
120 (cxx_init_decl_processing): Likewise.
122 2009-10-01 Jason Merrill <jason@redhat.com>
124 * pt.c (register_specialization): Push DECL_SOURCE_LOCATION to the
127 * decl.c (grok_special_member_properties): Only adjust
128 TYPE_HAS_COMPLEX_* if the function is defaulted in the class body.
129 (cp_finish_decl): Push DECL_DELETED_FN/DECL_DEFAULTED_FN to the
132 2009-09-30 Gabriel Dos Reis <gdr@cs.tamu.edu>
134 * decl.c (check_for_uninitialized_const_var): Check constexpr
136 (grokdeclarator): Handle `constexpr'.
137 (check_tag_decl): Reject `constexpr'.
138 (check_function_type): Check constexpr functions.
139 * cp-tree.h (ds_constexpr): New cp_decl_spec enumerator.
140 (CLASSTYPE_LITERAL_P): New.
141 (lang_type_class::is_literal): New.
142 (lang_type_class::dummy): Adjust width.
143 (literal_type_p): Declare.
144 * parser.c (cp_parser_check_decl_spec): Print it.
145 (cp_parser_decl_specifier_seq): Accept "constexpr".
146 * semantics.c (validate_constexpr_fundecl): Define.
147 (literal_type_p): Define.
149 2009-09-30 Jason Merrill <jason@redhat.com>
151 * semantics.c (lambda_expr_this_capture): Fix default capture
152 of explicit capture of 'this'.
154 2009-09-30 Jason Merrill <jason@redhat.com>
156 * parser.c (cp_parser_lambda_expression): Don't add __ to __this.
158 2009-09-30 Jason Merrill <jason@redhat.com>
160 * cp-tree.h (LANG_DECL_U2_CHECK): Check LANG_DECL_HAS_MIN.
162 2009-09-29 John Freeman <jfreeman08@gmail.com>
163 Jason Merrill <jason@redhat.com>
165 Add support for lambda-expressions as per N2927.
166 * cp-tree.def (VEC_INIT_EXPR, LAMBDA_EXPR): New.
167 * cp-tree.h (LAMBDA_TYPE_P, LAMBDA_FUNCTION_P): New.
168 (LAMBDA_EXPR_DEFAULT_CAPTURE_MODE): New.
169 (LAMBDA_EXPR_DEFAULT_CAPTURE_LIST): New.
170 (LAMBDA_EXPR_THIS_CAPTURE, LAMBDA_EXPR_CAPTURES_THIS_P): New.
171 (LAMBDA_EXPR_MUTABLE_P, LAMBDA_EXPR_DEDUCE_RETURN_TYPE_P): New.
172 (LAMBDA_EXPR_RETURN_TYPE, LAMBDA_EXPR_LOCATION): New.
173 (LAMBDA_EXPR_EXTRA_SCOPE, LAMBDA_EXPR_DISCRIMINATOR): New.
174 (struct tree_lambda_expr): New.
175 (union lang_tree_node): Add lambda_expression.
176 (struct lang_type_class): Add lazy_move_ctor flag, lambda_expr field.
177 (CLASSTYPE_LAZY_MOVE_CTOR, CLASSTYPE_LAMBDA_EXPR): New.
178 (LAMBDA_TYPE_EXTRA_SCOPE, VEC_INIT_EXPR_SLOT): New.
179 (VEC_INIT_EXPR_INIT, DECLTYPE_FOR_LAMBDA_CAPTURE): New.
180 (DECLTYPE_FOR_LAMBDA_RETURN): New.
181 (enum special_function_kind): Add sfk_move_constructor.
182 (LAMBDANAME_PREFIX, LAMBDANAME_FORMAT, LAMBDANAME_P): New.
183 * parser.c (cp_parser_lambda_expression, cp_parser_lambda_introducer)
184 (cp_parser_lambda_declarator_opt, cp_parser_lambda_body): New.
185 (start_lambda_scope, record_lambda_scope, finish_lambda_scope): New.
186 (no_linkage_lambda_type_p): New.
187 (cp_parser_primary_expression): Recognize lambda expression.
188 (cp_parser_init_declarator): Note lambda scope.
189 (cp_parser_function_definition_after_declarator): Likewise.
190 (cp_parser_late_parsing_default_args): Likewise.
191 (cp_parser_skip_to_closing_parenthesis): Skip to end of lambda capture
193 (cp_parser_parameter_declaration): Don't defer lambda default args.
194 * semantics.c (finish_non_static_data_member, finish_id_expression):
195 Handle default capture for lambda expressions.
196 (finish_this_expr): Handle 'this' keyword inside of lambda expressions.
197 (outer_automatic_var_p): New.
198 (finish_decltype_type): Handle decltypes within lambda expressions.
199 (classtype_has_nothrow_assign_or_copy_p): Synthesized move constructor.
200 (build_lambda_expr, build_lambda_object, begin_lambda_type)
201 (lambda_return_type, lambda_capture_field_type, apply_lambda_return_type)
202 (capture_decltype, add_capture, add_default_capture)
203 (lambda_expr_this_capture): New.
204 * mangle.c (write_unnamed_type_name): New. Incomplete.
205 (write_closure_type_name): New.
206 (write_unqualified_name): Recognize unnamed, closure types.
207 (write_type): Do not write decltypes from lambda expressions.
208 (decl_mangling_context): New.
209 (write_name): Use it. Handle PARM_DECL scope.
210 (write_prefix): Likewise. Handle VAR_DECL/FIELD_DECL scope.
211 (write_compact_number): Factor out from...
212 (write_expression, write_template_param): ...here.
213 (discriminator_for_local_entity): Recognize lambdas.
214 (write_local_name): Handle PARM_DECL scope.
215 * typeck.c (structural_comptypes): Compare decltypes from lambda
217 (check_return_expr): Deduce lambda return type from multiple return
219 * class.c (add_implicitly_declared_members): Add lazy move constructor
221 (check_bases_and_members): Delete default constructor and assignment
222 operator for lambda types.
223 (maybe_note_name_used_in_class): Do not confuse lambda expression with
225 * decl.c (reshape_init_r): Array copy.
226 (grokfndecl): Synthesized move constructor.
227 (cp_tree_node_structure): Lambda expression.
228 * method.c (use_thunk): Synthesized move constructor.
229 (do_build_copy_constructor): Likewise.
230 (locate_copy): Likewise.
231 (implicitly_declare_fn): Likewise.
232 * cp-objcp-common.c (cp_tree_size): Handle LAMBDA_EXPR.
233 * error.c (dump_aggr_type): Recognize lambda type.
234 (dump_function_decl): Recognize lambda function.
235 (function_category): Likewise.
236 (dump_function_name): Hide lambda name.
237 * tree.c (build_array_copy, move): New.
238 (special_function_p): Synthesized move constructor.
239 (no_linkage_check): Handle lambdas.
240 * search.c (lookup_fnfields_1): Synthesized move constructor.
241 * cp-gimplify.c (cp_gimplify_init_expr, cp_gimplify_expr):
242 Handle VEC_INIT_EXPR.
243 * typeck2.c (digest_init_r): Array copy.
244 * pt.c (get_template_info): Don't touch typedefs.
245 (instantiate_decl): Don't resubstitute artificial decls.
246 (tsubst_decl, tsubst, tsubst_copy_and_build): Handle lambdas.
247 (lookup_template_class): Don't fall back on name lookup.
248 * name-lookup.c (make_lambda_name): New.
249 (pushdecl_class_level): Handle default capture for lambda expressions.
250 (qualify_lookup): Handle decltypes within lambda expressions.
251 (pushtag): Handle ts_within_enclosing_non_class in function scope.
253 2009-09-28 Janis Johnson <janis187@us.ibm.com>
255 * mangle.c (write_builtin_type): Support decimal float types.
257 2009-09-28 Richard Henderson <rth@redhat.com>
259 * cp-objcp-common.h (LANG_HOOKS_EH_USE_CXA_END_CLEANUP): New.
261 2009-09-24 Jakub Jelinek <jakub@redhat.com>
263 * method.c (make_thunk, make_alias_for): Don't set
264 DECL_NO_STATIC_CHAIN.
265 * decl.c (builtin_function_1, grokfndecl): Likewise.
266 * lex.c (build_lang_decl): Likewise.
268 2009-09-23 Dodji Seketeli <dodji@redhat.com>
271 * decl.c (cp_finish_decl): Record the types used by the global
272 variable declaration we've just parsed.
274 2009-09-22 Dodji Seketeli <dodji@redhat.com>
276 * cp-lang.c (LANG_HOOKS_FUNCTION_PARAMETER_PACK_P,
277 LANG_HOOKS_FUNCTION_PARM_EXPANDED_FROM_PACK_P,
278 LANG_HOOKS_GET_GENERIC_FUNCTION_DECL): Initialize these
279 hooks for the c++ FE.
280 * cp-tree.h (function_parameter_pack_p, get_function_template_decl,
281 function_parameter_expanded_from_pack_p): Declare ...
282 * pt.c (function_parameter_pack_p, get_function_template_decl,
283 function_parameter_expanded_from_pack_p): ... new hooks.
284 (get_template_info): Make this more robust.
285 (template_args_variadic_p, make_ith_pack_parameter_name): Add a new
286 line between comment and function.
287 (get_template_argument_pack_elems): Fix comment.
288 (tsubst_decl): Arguments of function parameter packs are not
289 parameter packs themselves.
291 2009-09-21 Jason Merrill <jason@redhat.com>
294 * tree.c (trivial_type_p): Fix logic.
296 2009-09-21 Jason Merrill <jason@redhat.com>
298 * name-lookup.c (push_class_level_binding): Sanity check.
300 2009-09-18 Jason Merrill <jason@redhat.com>
302 * decl2.c (determine_visibility): Make anonymous types internal.
303 (mark_used): Complain about types without linkage used in
304 decls with internal linkage.
305 (vague_linkage_fn_p): Split out from...
306 * decl.c (maybe_commonize_var): ...here.
307 (grokdeclarator): Adjust linkage when a typedef gives linkage name.
308 * tree.c (no_linkage_check): Check the enclosing class and template
311 * cp-tree.h (TYPE_NAMESPACE_SCOPE_P): New.
313 * pt.c (get_pattern_parm): New.
314 (listify): Split out from...
315 (listify_autos): ...here.
316 (unify): Deduce std::initializer_list for T.
317 * call.c (build_over_call): Warn about it.
319 2009-09-17 Andrew Pinski <pinskia@gcc.gnu.org>
322 * typeck.c (cp_build_unary_op): Check TREE_CODE for bools instead of
324 (convert_for_assignment): Likewise.
325 * cvt.c (type_promotes_to): Likewise.
327 2009-09-14 Richard Henderson <rth@redhat.com>
328 Jakub Jelinek <jakub@redhat.com>
330 * cp-tree.h (finish_asm_stmt): Update decl.
331 * parser.c (cp_parser_asm_definition): Parse asm goto.
332 (cp_parser_asm_label_list): New.
333 * pt.c (tsubst_copy_asm_operands): Don't recurse on labels.
334 (tsubst_expr): Handle asm labels.
335 * semantics.c (finish_asm_stmt): Add and use labels parameter.
337 2009-09-14 Richard Henderson <rth@redhat.com>
339 * except.c (init_exception_processing): Don't call
340 default_init_unwind_resume_libfunc.
341 (cp_protect_cleanup_actions): Return the decl to call.
342 (build_exc_ptr): Use __builtin_eh_pointer.
343 * optimize.c (clone_body): Set eh_lp_nr, not eh_region.
345 2009-09-13 Richard Guenther <rguenther@suse.de>
346 Rafael Avila de Espindola <espindola@google.com>
348 * except.c (init_exception_processing): Do not set
349 lang_eh_runtime_type.
350 (choose_personality_routine): Do not set eh_personality_decl,
351 set pragma_java_exceptions.
352 * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define.
353 (LANG_HOOKS_EH_PERSONALITY): Likewise.
354 (cp_eh_personality_decl): New.
355 (cp_eh_personality): Likewise.
356 * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H)
359 2009-09-13 Wei Guozhi <carrot@google.com>
362 * cp/optimize.c (build_delete_destructor_body): New function.
363 (maybe_clone_body): Call build_delete_destructor_body for
366 2009-09-10 Jason Merrill <jason@redhat.com>
368 * repo.c (extract_string, get_base_filename, init_repo): constify.
370 2009-09-09 Jason Merrill <jason@redhat.com>
372 * error.c (find_typenames_r): Also add decltypes.
374 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com>
377 * decl2.c (grokfield): Check for explicit template argument lists.
379 2009-09-09 Jack Howarth <howarth@bromo.med.uc.edu>
382 * Make-lang.in: Remove redundant code from linkage for darwin10.
384 2009-09-08 Paolo Carlini <paolo.carlini@oracle.com>
387 * decl.c (build_init_list_var_init): Check return value of
388 perform_implicit_conversion.
390 2009-09-08 Jason Merrill <jason@redhat.com>
392 * class.c (currently_open_class): Make sure we're dealing with the
395 * cp-tree.h (enum overload_flags): Remove OP_FLAG.
396 * method.c (lazily_declare_fn): Check for dtorness in ABI warning.
398 * name-lookup.c (is_class_level): Remove.
399 (push_binding_level, leave_scope, resume_scope): Adjust.
400 (pushlevel_class): Adjust.
401 (poplevel_class): Make sure we're on class_binding_level.
403 * decl.c (grokmethod): Rename from start_method.
404 (finish_method): Remove.
406 * parser.c (cp_parser_save_member_function_body): Adjust.
408 2009-09-03 Doug Kwan <dougkwan@google.com>
410 * tree.c (cp_fix_function_decl_p): New.
411 (cp_free_lang_data): New.
413 2009-09-03 Diego Novillo <dnovillo@google.com>
415 * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H).
416 * decl2.c: Include pointer-set.h.
417 (collect_candidates_for_java_method_aliases): New.
418 (cp_write_global_declarations): Call it.
419 Add local variable CANDIDATES. If set, call
420 build_java_method_aliases.
421 (build_java_method_aliases): Add argument CANDIDATES.
422 Use it to determine if FNDECL should get a hidden alias.
423 * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define.
424 * cp-tree.h (cp_free_lang_data): Declare.
426 2009-09-03 Richard Guenther <rguenther@suse.de>
428 * method.c (use_thunk): Use cgraph_finalize_function to hand
429 off thunks to the cgraph.
430 * semantics.c (emit_associated_thunks): Do not emit thunks
431 for really extern functions.
433 2009-09-03 Diego Novillo <dnovillo@google.com>
435 * cp-lang.c (lang_hooks): Remove const qualifier.
437 2009-09-02 Jason Merrill <jason@redhat.com>
439 * semantics.c (describable_type): Don't pretend to be in a template.
441 * ptree.c (cxx_print_type) [DECLTYPE_TYPE]: Print the expression.
443 2009-09-01 Alexandre Oliva <aoliva@redhat.com>
445 * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New.
446 * cp-lang.c (cxx_dwarf_name): Pass it.
447 * error.c (count_non_default_template_args): Take flags as
448 argument. Adjust all callers. Skip counting of default
449 arguments if the new flag is given.
451 2009-09-01 Dodji Seketeli <dodji@redhat.com>
454 * pt.c (make_ith_pack_parameter_name): Don't use strnlen that is a
457 2009-09-01 Richard Guenther <rguenther@suse.de>
459 * cp-objcp-common.c (cp_expr_size): Use tree_expr_size.
460 * cp-objcp-common.h (LANG_HOOKS_EXPR_SIZE): Do not define.
462 2009-09-01 Richard Guenther <rguenther@suse.de>
464 * cp-objcp-common.h (LANG_HOOKS_MARK_ADDRESSABLE): Remove.
466 2009-08-31 Dodji Seketeli <dodji@redhat.com>
469 * cp-tree.h (get_template_info): Parameter should be const.
470 (CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P): Fix typo.
471 (get_template_argument_pack_elems,
472 get_primary_template_innermost_parameters,
473 get_template_innermost_arguments, template_template_parameter_p):
475 * pt.c (get_template_argument_pack_elems,
476 get_template_innermost_parameters, get_template_innermost_arguments,
477 template_template_parameter_p):
478 ... New C++ front end implementation of new language hooks.
479 (primary_template_instantiation_p): New private helper.
480 (make_ith_pack_parameter_name): Use snprintf and strnlen instead of
482 (get_template_info): Const-ify parameter.
483 * cp-lang.c (LANG_HOOKS_GET_INNERMOST_GENERIC_PARMS,
484 LANG_HOOKS_GET_INNERMOST_GENERIC_ARGS,
485 LANG_HOOKS_GET_ARGUMENT_PACK_ELEMS,
486 LANG_HOOKS_GENERIC_TYPE_PARAMETER_DECL_P): Initialize these
487 interfaces for the C++ front-end.
489 2009-08-31 Jason Merrill <jason@redhat.com>
492 * parser.c (cp_parser_enum_specifier): Make sure the : is followed by a
493 type-specifier-seq before we commit.
495 2009-08-28 Richard Guenther <rguenther@suse.de>
498 * cp-gimplify.c (cp_genericize_r): Do not leak zero-sized stores
501 2009-08-27 Richard Guenther <rguenther@suse.de>
503 * class.c (build_vtbl_ref_1): Remove excess vertical space.
504 * Make-lang.in (CXX_TREE_H): Remove c-common.def dependency
505 tracked by $(TREE_H).
506 * semantics.c (expand_or_defer_fn): Zero DECL_SAVED_TREE.
508 2009-08-26 Jason Merrill <jason@redhat.com>
510 * call.c (build_builtin_candidate): Don't set LOOKUP_ONLYCONVERTING
511 if we're contextually converting to bool.
512 (build_conditional_expr): Likewise.
513 * typeck.c (condition_conversion): Likewise.
515 * call.c (build_conditional_expr): Fix logic errors.
516 (build_new_op): Remove dead COND_EXPR handling.
518 2009-08-24 Jason Merrill <jason@redhat.com>
520 * cp-tree.h (DECL_DEFERRED_FN): Remove.
521 (struct lang_decl_fn): Remove deferred flag.
522 * class.c (build_clone): Don't set it.
523 * decl2.c (note_vague_linkage_fn): Don't check or set it.
524 (mark_used): Don't check it.
525 * method.c (make_thunk, make_alias_for): Don't set it.
527 * decl2.c (mark_used): Streamline logic.
532 * cp-tree.h (DECL_ODR_USED): New macro.
533 (struct lang_decl_base): Add odr_used flag.
534 * decl.c (duplicate_decls): Propagate it. Use it for error.
535 * pt.c (register_specialization): Use it for error.
536 * decl2.c (mark_used): Use it as gating flag rather than TREE_USED.
537 (cp_write_global_declarations): Use it for error.
538 (tree_used_ok): Remove.
539 * cp-tree.h: Remove tree_used_ok.
540 * call.c (build_call_a): Don't call it.
541 * init.c (build_offset_ref): Likewise.
543 2009-08-21 Jakub Jelinek <jakub@redhat.com>
546 * tree.c (lvalue_p_1) <case CONST_DECL>: Return clk_none if
549 2009-08-19 Jason Merrill <jason@redhat.com>
553 * decl2.c (mark_used): Increment function_depth during synthesis.
554 * parser.c (cp_parser_default_argument): Not here.
556 2009-08-19 Jakub Jelinek <jakub@redhat.com>
558 * method.c (use_thunk): Call free_after_compilation after
559 assemble_end_function.
561 2009-08-17 Richard Guenther <rguenther@suse.de>
563 * decl.c (build_ptrmemfunc_type): Keep variant chain intact.
565 (finish_enum): Keep variant chain intact.
566 * tree.c (cp_build_reference_type): Likewise.
568 2009-08-16 Jason Merrill <jason@redhat.com>
570 Make TREE_USED match the [basic.def.odr] concept for FUNCTION_DECL
571 and VAR_DECL, so mark_used only has effect the first time.
572 * decl2.c (mark_used): Just return if TREE_USED is already set.
573 Don't set TREE_USED if cp_unevaluated_operand is set.
574 (tree_used_ok): New fn.
575 * init.c (build_offset_ref): Check it instead of TREE_USED.
576 * call.c (build_call_a): Likewise.
577 * cp-tree.h: Declare it.
578 (DECL_NO_LINKAGE_CHECKED): No longer needed.
579 (struct lang_decl_base): Remove no_linkage_checked bitfield.
581 * decl2.c (finish_static_data_member_decl): Don't set TREE_USED.
583 * decl2.c (mark_used): It's ok to synthesize for default args now.
585 2009-08-10 Jason Merrill <jason@redhat.com>
587 Implement DR 757: It's OK for a decl to use a type without linkage
588 so long as the decl is defined in the current translation unit.
589 * decl2.c (no_linkage_decls): New vector.
590 (mark_used): Add decls that use types with no linkage.
591 (cp_write_global_declarations): Check that they are defined.
592 (decl_defined_p, no_linkage_error): New fns.
593 * cp-tree.h (DECL_NO_LINKAGE_CHECKED): New macro.
594 (struct lang_decl_base): Add flag.
595 * decl.c (grokfndecl): Don't check type linkage.
596 (grokvardecl): If the type has no linkage, just make sure
597 DECL_LANG_SPECIFIC is set.
598 * pt.c (check_instantiated_arg): Don't check type linkage.
599 * name-lookup.c (is_local_extern): New fn.
600 * name-lookup.h: Declare it.
602 2009-08-05 Jason Merrill <jason@redhat.com>
605 * init.c (build_vec_init): Evaluate the initializer before
606 starting the initialization try block.
608 2009-08-05 Manuel López-Ibáñez <manu@gcc.gnu.org>
611 * typeck.c (convert_for_assignment): Do not warn for any boolean
612 variant. Use explicit location.
614 2009-08-04 Dodji Seketeli <dodji@redhat.com>
617 * pt.c (tsubst_default_argument): Let access checks of the
618 default argument happen in the context of the current function.
620 2009-08-04 Manuel López-Ibáñez <manu@gcc.gnu.org>
623 * call.c (build_new_op): Only try prefix operator if -fpermissive,
624 otherwise just error.
626 2009-08-04 Dodji Seketeli <dodji@redhat.com>
629 * error.c (lang_decl_name): Print qualified names for decls
632 2009-08-03 Jason Merrill <jason@redhat.com>
633 Jakub Jelinek <jakub@redhat.com>
636 * init.c (build_vec_init): Look through a TARGET_EXPR around a
639 2009-07-31 Jason Merrill <jason@redhat.com>
640 Douglas Gregor <doug.gregor@gmail.com>
642 Remove implicit binding of lvalues to rvalue references (N2831)
643 * call.c (convert_class_to_reference): Binding an lvalue to an
644 rvalue reference is bad. If the user-defined conversion is bad,
645 set bad_p before merging conversions.
646 (maybe_handle_ref_bind): Don't push down bad_p.
647 (reference_binding): Binding an lvalue to an rvalue reference is bad.
648 (convert_like_real): Give a helpful error about binding lvalue
650 (reference_related_p): No longer static.
651 * typeck.c (build_typed_address): New.
652 (build_static_cast_1): Add static_cast from lvalue to &&.
655 2009-07-31 Jason Merrill <jason@redhat.com>
657 * call.c (reference_binding): Rename lvalue_p to is_lvalue.
658 Do direct binding of "rvalues" in memory to rvalue references.
659 * tree.c (lvalue_p_1): Can't be both non-addressable lvalue and
661 * typeck.c (build_static_cast_1): Do direct binding of memory
662 "rvalues" to rvalue references.
663 * cvt.c (cp_fold_convert): New.
664 * cp-tree.h: Declare it.
666 2009-07-31 Jason Merrill <jason@redhat.com>
668 * typeck.c (build_address): Do fold away ADDR_EXPR of INDIRECT_REF.
669 * tree.c (rvalue): Use cp_build_qualified_type, not TYPE_MAIN_VARIANT.
671 2009-07-29 Jason Merrill <jason@redhat.com>
674 * cp-tree.h (enum tsubst_flags): Add tf_no_class_instantiations.
675 * error.c (count_non_default_template_args): Pass it.
676 * pt.c (tsubst) [TYPENAME_TYPE]: Don't complete type if it's set.
678 2009-07-29 Richard Guenther <rguenther@suse.de>
681 * cp-gimplify.c (cp_genericize_r): Properly walk the BIND_EXPR
684 2009-07-26 Simon Martin <simartin@users.sourceforge.net>
687 * decl.c (grokdeclarator): Do not set TREE_NO_WARNING for functions
688 with a qualified return type.
690 2009-07-24 Jason Merrill <jason@redhat.com>
693 * call.c (build_op_delete_call): If this is for a new-expression
694 and the op delete is deleted, do nothing.
697 * call.c (compare_ics): Give list-initialization of std::init_list
698 priority over conversion to scalar, too.
700 2009-07-22 Jason Merrill <jason@redhat.com>
702 * mangle.c (mangle_type_string_for_rtti): Rename to be clearer.
703 (needs_fake_anon): New.
704 (write_name): Check it.
705 (write_nested_name): Add a fake anonymous namespace scope if true.
706 * name-lookup.c (get_anonymous_namespace_name): No longer static.
707 * rtti.c, cp-tree.h: Adjust.
709 2009-07-22 Richard Guenther <rguenther@suse.de>
712 * cp-gimplify.c (cp_gimplify_expr): Move handling of using
714 (cp_genericize_r): ... genericization stage.
715 (cp_genericize): Adjust.
717 2009-07-21 Jason Merrill <jason@redhat.com>
720 * call.c (reference_binding): Implement binding to { }.
721 (initialize_reference): Binding temporary to non-const && is fine.
722 * decl.c (grok_reference_init): Remove error for CONSTRUCTOR.
724 * decl.c (reshape_init_r): { T } is not an aggregate initializer
727 2009-07-17 Richard Guenther <rguenther@suse.de>
730 * decl.c (finish_function): Do not emit unused result warnings
732 * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use
733 c_warn_unused_result_pass.
734 * semantics.c (expand_or_defer_fn): Adjust assertion about IL status.
735 * optimize.c (clone_body): Clone in GENERIC.
736 (maybe_clone_body): Do not clear DECL_SAVED_TREE.
737 * decl2.c (cp_write_global_declarations): Fix body test.
738 Do not call cgraph_optimize.
739 * Make-lang.in (optimize.o): Add tree-iterator.h dependency.
740 * method.c (use_thunk): Register thunk with
741 cgraph_finalize_function.
742 * error.c (function_category): Guard access of DECL_LANG_SPECIFIC.
744 2009-07-17 Richard Guenther <rguenther@suse.de>
746 * init.c (build_vec_delete_1): Do not set DECL_REGISTER on the
749 2009-07-17 Aldy Hernandez <aldyh@redhat.com>
750 Manuel López-Ibáñez <manu@gcc.gnu.org>
753 * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c,
754 tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c,
755 call.c, cvt.c, mangle.c: Add location argument to
756 fold_{unary,binary,ternary}, fold_build[123], build_call_expr,
757 build_size_arg, build_fold_addr_expr, build_call_array,
758 non_lvalue, size_diffop, fold_build1_initializer,
759 fold_build2_initializer, fold_build3_initializer,
760 fold_build_call_array, fold_build_call_array_initializer,
761 fold_single_bit_test, omit_one_operand, omit_two_operands,
762 invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref,
763 fold_indirect_ref, combine_comparisons, fold_builtin_*,
764 fold_call_expr, build_range_check, maybe_fold_offset_to_address,
765 round_up, round_down.
767 2009-07-16 Jason Merrill <jason@redhat.com>
770 Split POD into "standard-layout" and "trivial" as per N2230,
771 Support std::is_standard_layout and std::is_trivial traits.
772 * cp-tree.h (enum cp_trait_kind): Add CPTK_IS_STD_LAYOUT,
774 (struct lang_type_class): Add non_std_layout.
775 (CLASSTYPE_NON_STD_LAYOUT): New.
776 * class.c (check_bases): Set it.
777 (check_field_decls): Likewise.
778 (check_bases_and_members): Likewise.
779 * parser.c (cp_parser_primary_expression): Handle RID_IS_STD_LAYOUT,
781 (cp_parser_trait_expr): Likewise.
782 * semantics.c (trait_expr_value): Handle CPTK_IS_STD_LAYOUT,
784 (finish_trait_expr): Likewise.
785 * tree.c (scalarish_type_p, trivial_type_p, std_layout_type_p): New.
786 (pod_type_p): Use them.
787 (type_has_nontrivial_copy_init, type_has_nontrivial_default_init): New.
789 Adjust bits of the language that no longer refer to POD types.
790 * call.c (convert_arg_to_ellipsis): Use type_has_nontrivial_copy_init
791 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
792 (build_x_va_arg): Likewise.
793 (call_builtin_trap): Remove.
794 * decl.c (declare_local_label): Use type_has_nontrivial_default_init
795 and TYPE_HAS_NONTRIVIAL_DESTRUCTOR rather than pod_type_p.
796 (cp_finish_decl): Likewise.
797 (check_previous_goto_1, check_goto): Adjust error.
798 * typeck.c (build_class_member_access_expr): Check
799 CLASSTYPE_NON_STD_LAYOUT rather than CLASSTYPE_NON_POD_P.
801 2009-07-14 Taras Glek <tglek@mozilla.com>
802 Rafael Espindola <espindola@google.com>
804 * Make-lang.in: Added CP_PLUGIN_HEADERS and
805 c.install-target to export cp-tree.h cxx-pretty-print.h
806 name-lookup.h headers for plugins.
808 2009-07-14 Jason Merrill <jason@redhat.com>
811 * decl.c (decls_match): A non-extern-C declaration doesn't match
812 a builtin extern-C declaration.
815 * name-lookup.c (qualified_lookup_using_namespace): Don't stop
816 looking in used namespaces just because we found something on
820 * semantics.c (perform_koenig_lookup): Handle empty template args.
822 * call.c (build_over_call): Use can_trust_pointer_alignment.
824 2009-07-14 Dodji Seketeli <dodji@redhat.com>
828 * decl2.c (grokfield): Don't call set_underlying_type on typedef
829 decls that are type names.
831 2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
834 * parser.c (cp_parser_elaborated_type_specifier): Accept typename in
835 front of qualified names.
837 2009-07-12 Jason Merrill <jason@redhat.com>
840 * tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
843 * cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
844 * tree.c (lvalue_p_1): Return it. Remove
845 treat_class_rvalues_as_lvalues parm.
846 (real_lvalue_p): Disallow pseudo-lvalues here.
847 (lvalue_or_rvalue_with_address_p): New fn.
848 * call.c (initialize_reference): Use it instead of real_lvalue_p.
851 * init.c (build_new_1): Handle initializer list as array initializer.
852 (build_vec_init): Likewise.
853 * typeck.c (cp_build_modify_expr): Likewise.
854 * typeck2.c (process_init_constructor_array): Error rather than abort
855 if too many initializers.
857 2009-07-10 Jakub Jelinek <jakub@redhat.com>
860 * error.c (cp_print_error_function): Check for NULL block.
862 2008-07-09 Simon Martin <simartin@users.sourceforge.net>
863 Jason Merrill <jason@redhat.com>
865 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
866 append_type_to_template_for_access_check_1): Use CLASS_TYPE_P.
868 2009-07-09 Dodji Seketeli <dodji@redhat.com>
871 * pt.c (type_unification_real): Use tsubst_template_arg instead
872 of tsubst to substitute default template arguments.
874 2009-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
877 * init.c (build_new_1): Set TREE_NO_WARNING for compiler-generated
879 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
882 2009-07-07 Jason Merrill <jason@redhat.com>
885 * pt.c (tsubst_decl): Don't abort if we didn't change anything
886 in a TEMPLATE_DECL's args.
888 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
890 * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
893 2009-07-07 Jason Merrill <jason@redhat.com>
896 * decl.c (build_enumerator): Don't add enumerators for a
897 scoped enum to the enclosing class.
900 * decl.c (start_enum): Allow dependent underlying type.
903 * decl.c (finish_enum): Finish scope even in a template.
905 2009-07-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
907 * init.c: Replace %J by an explicit location. Update all calls.
909 * typeck2.c: Likewise.
911 * name-lookup.c: Likewise.
913 2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
915 * decl.c: Replace %H by an explicit location. Update all calls.
916 * except.c: Likewise.
917 * semantics.c: Likewise.
918 * parser.c: Likewise.
920 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
923 * pt.c (perform_typedefs_access_check, get_types_needing_access_check,
924 append_type_to_template_for_access_check_1): Use
925 RECORD_OR_UNION_CODE_P.
927 2009-07-04 Jason Merrill <jason@redhat.com>
929 * pt.c (retrieve_specialization): Don't get confused by a
930 using-declaration that brings in another instance of this template
933 * ptree.c (cxx_print_type): Fix logic.
935 * cp-tree.h (LANG_DECL_FN_CHECK): Fix non-checking version.
938 * cp-tree.h (struct lang_decl_parm): New.
939 (struct lang_decl): Add it.
940 (LANG_DECL_PARM_CHECK): New.
941 (DECL_PARM_INDEX): New.
942 * decl2.c (parm_index): Remove.
943 * lex.c (retrofit_lang_decl): Handle parms.
944 (cxx_dup_lang_specific_decl): Likewise.
945 * mangle.c (write_expression): Adjust.
946 * tree.c (cp_tree_equal): Adjust.
947 (decl_linkage): Only check DECL_COMDAT for functions and variables.
948 * parser.c (cp_parser_parameter_declaration_list): Set
950 * pt.c (iterative_hash_template_arg): Hash it.
952 2009-07-03 Jason Merrill <jason@redhat.com>
954 * cp-tree.h (struct lang_decl): Overhaul.
955 (struct lang_decl_flags): Remove.
956 (struct lang_decl_base): New.
957 (struct lang_decl_min): New.
958 (struct lang_decl_fn): New.
959 (struct lang_decl_ns): New.
960 (CAN_HAVE_FULL_LANG_DECL_P): Replace with LANG_DECL_HAS_MIN.
961 (LANG_DECL_MIN_CHECK): New.
962 (LANG_DECL_FN_CHECK): New.
963 (LANG_DECL_NS_CHECK): New.
964 (STRIP_TEMPLATE): New.
965 (NON_THUNK_FUNCTION_CHECK): Remove.
966 (DECL_DECLARES_FUNCTION_P): New.
968 * lex.c (retrofit_lang_decl, cxx_dup_lang_specific_decl): Adjust.
969 * decl.c (push_local_name, duplicate_decls): Adjust.
970 * decl2.c (start_objects): Don't set u2sel.
971 * semantics.c (finish_omp_threadprivate): Adjust.
972 * class.c (build_clone): Don't do much on TEMPLATE_DECLs.
973 (decl_cloned_function_p): Out-of-line implementation of macros.
974 (clone_function_decl, adjust_clone_args): Use DECL_CLONED_FUNCTION_P.
975 * mangle.c (write_unqualified_name): Don't check function flags
977 * method.c (make_alias_for): Don't set DECL_CLONED_FUNCTION.
978 * pt.c (build_template_decl): Don't set function flags.
979 (check_default_tmpl_args): Check that it's a function.
980 (instantiate_template): Use DECL_ABSTRACT_ORIGIN to find the
983 * pt.c (tsubst_decl) [FUNCTION_DECL]: Don't tsubst
984 DECL_CLONED_FUNCTION.
986 * cp-tree.h (struct lang_type_class): Move sorted_fields here.
987 * class.c (finish_struct_1): Adjust.
988 * ptree.c (cxx_print_decl, cxx_print_type): Adjust.
989 * search.c (lookup_field_1): Adjust.
991 * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Remove.
992 * decl.c (finish_method): Don't add to it.
993 * class.c (fixup_pending_inline): Remove.
994 (fixup_inline_methods): Remove.
995 (finish_struct_1): Don't call it.
997 * error.c (dump_function_name): Handle null name.
999 2009-07-02 Mark Mitchell <mark@codesourcery.com>
1001 * typeck.c (cp_build_binary_op): Move warnings about use of NULL
1002 in arithmetic earlier and allow comparisions of NULL with
1003 pointers-to-members.
1005 2009-07-02 Jason Merrill <jason@redhat.com>
1007 Use hash tables for template specialization lookup.
1008 * pt.c (struct spec_entry): New type.
1009 (decl_specializations, type_specializations): New hash tables.
1010 (register_specialization, retrieve_specialization): Use them.
1011 (reregister_specialization, lookup_template_class): Use them.
1012 (eq_specializations, hash_tmpl_and_args, hash_specialization): New.
1013 (iterative_hash_template_arg): New.
1014 (init_template_processing): New
1015 (process_partial_specialization): Don't look to see if we already
1016 have this partial specialization.
1017 (maybe_process_partial_specialization): Handle reassigning
1018 full specializations when we get an explicit specialization
1019 of the partial instantiation.
1020 (tsubst_friend_function): Adjust specialization reassignment code.
1021 (instantiate_template): Only do one lookup.
1022 (instantiate_decl): Don't do any lookup.
1023 * cp-tree.h: Declare init_template_processing.
1024 * decl.c (duplicate_decls): Pass args to reregister_specialization.
1026 2009-07-01 Jason Merrill <jason@redhat.com>
1028 * cp-tree.h (DECL_CLASS_TEMPLATE_P): Use DECL_IMPLICIT_TYPEDEF_P.
1030 * pt.c (register_specialization): Use duplicate_decls to merge
1031 the argument with a previous specialization.
1032 (check_explicit_specialization): Call register_specialization to
1033 merge the TEMPLATE_DECL with a previous version.
1034 (determine_specialization): Return the args even if fn is a template.
1036 2009-07-01 Ian Lance Taylor <iant@google.com>
1038 * g++spec.c (lang_specific_driver): Bump num_args by 1.
1040 2009-06-30 Jason Merrill <jason@redhat.com>
1043 * pt.c (tsubst_pack_expansion): Handle unexpanded packs in an
1044 EXPR_PACK_EXPANSION.
1046 2009-06-29 Jason Merrill <jason@redhat.com>
1049 * error.c (dump_template_parms): Pass all args to
1050 count_non_default_template_args.
1051 (count_non_default_template_args): Pull out the inner ones.
1053 2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
1055 * decl.c (duplicate_decls): Re-indent.
1057 2009-06-25 Ian Lance Taylor <iant@google.com>
1059 * call.c (avoid_sign_compare_warnings): New static function.
1060 (build_new_op): Call it.
1061 * typeck.c (cp_build_binary_op): Don't call warn_sign_compare if
1062 TREE_NO_WARNING is set on either operand.
1064 2009-06-25 Ian Lance Taylor <iant@google.com>
1066 * g++spec.c (SKIPOPT): define.
1067 (lang_specific_driver): Handle -static-libstdc++. Only add
1068 LIBSTDCXX_STATIC if we add LIBSTDCXX.
1070 2009-06-25 Ian Lance Taylor <iant@google.com>
1072 * cvt.c (convert_to_void): Only warn about COND_EXPR if neither
1073 the second nor third operand has side effects.
1075 2009-06-25 Ian Lance Taylor <iant@google.com>
1077 * parser.c (cp_parser_binary_expression): Increment
1078 c_inhibit_evaluation_warnings while parsing the right hand side of
1079 "true || x" or "false && x".
1080 * typeck.c (cp_build_binary_op): Only call warn_for_sign_compare
1081 if c_inhibit_evaluation_warnings is zero.
1083 2009-06-24 Jason Merrill <jason@redhat.com>
1085 * error.c (dump_decl): Do say "typedef" for the injected class name.
1087 * pt.c (lookup_template_class): Use currently_open_class,
1088 compare template args later.
1091 * decl.c (decls_match): Check DECL_TI_TEMPLATE too.
1092 * class.c (resolve_address_of_overloaded_function): Fix typo.
1094 2009-06-18 Aldy Hernandez <aldyh@redhat.com>
1096 * class.c (get_vtable_decl): Replace finish_decl with cp_finish_decl.
1097 * decl.c (finish_decl): Remove.
1098 (declare_global_var): Replace finish_decl with cp_finish_decl.
1099 (start_method): Same.
1100 * rtti.c (emit_tinfo_decl): Same.
1101 * pt.c (tsubst_expr): Same.
1102 (instantiate_decl): Same.
1103 * decl2.c (grokbitfield): Same.
1104 * name-lookup.c (pushdecl_top_level_1): Same.
1105 * cp-tree.h: Remove finish_decl.
1107 2009-06-16 David Edelsohn <edelsohn@gnu.org>
1109 * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL.
1110 (lang_specific_driver): Always allocate extra argument.
1111 Add LIBSTDCXX_STATIC to arglist if defined and linking
1114 2009-06-16 Ian Lance Taylor <iant@google.com>
1116 * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
1117 (cp/semantics.o): Depend upon gt-cp-semantics.h.
1119 2009-06-16 Ian Lance Taylor <iant@google.com>
1121 * parser.c (cp_unevaluated_operand): Define global variable.
1122 (cp_parser_question_colon_clause): Increment
1123 c_inhibit_evaluation_warnings when evaluating an expression which
1124 will never be executed.
1125 (cp_parser_decltype): Increment cp_unevaluated_operand and
1126 c_inhibit_evaluation_warnings, not skip_evaluation.
1127 (cp_parser_sizeof_operand): Likewise.
1128 (cp_parser_enclosed_template_argument_list): Save
1129 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1131 * cp-tree.h (struct saved_scope): Remove skip_evaluation field.
1132 Add unevaluated_operand and inhibit_evaluation_warnings fields.
1133 (cp_unevaluated_operand): Declare.
1134 * name-lookup.c (push_to_top_level): Save cp_unevaluated_operand
1135 and c_inhibit_evaluation_warnings rather than skip_evaluation.
1136 (pop_from_top_level): Restore cp_unevaluated_operand and
1137 c_inhibit_evaluation_warnings rather than skip_evaluation.
1138 * class.c (build_base_path): Check cp_unevaluated_operand rather
1139 than skip_evaluation.
1140 * typeck.c (build_class_member_access_expr): Likewise.
1141 (cp_build_binary_op): Don't warn about bad shift counts if
1142 c_inhibit_evaluation_warnings is non-zero.
1143 * pt.c (coerce_template_parms): Save state of
1144 cp_unevaluated_operand and c_inhibit_evaluation_warnings, not
1146 (tsubst_aggr_type): Likewise.
1147 (tsubst_pack_expansion): Check cp_unevaluated_operand rather than
1149 (tsubst_copy): Likewise.
1150 (tsubst): Set cp_unevaluated_operand and
1151 c_inhibit_evaluation_warnings, not skip_evaluation.
1152 (tsubst_copy_and_build): Likewise.
1153 * call.c (convert_arg_to_ellipsis): Check cp_unevaluated_operand
1154 rather than skip_evaluation.
1155 * decl2.c (mark_used): Likewise.
1156 * semantics.c (finish_non_static_data_member): Likewise.
1157 * cvt.c (cp_convert_and_check): Check
1158 c_inhibit_evaluation_warnings rather than skip_evaluation.
1159 * mangle.c (write_type): Set cp_unevaluated_operand rather than
1162 2009-06-15 Ian Lance Taylor <iant@google.com>
1164 * parser.c (cp_parser_direct_declarator): Add braces around
1165 variables declared before label.
1167 2009-06-15 Rafael Avila de Espindola <espindola@google.com>
1169 * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove.
1170 * cp-tree.h (cxx_comdat_group): Change signature.
1171 * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP.
1172 (cxx_comdat_group): Change signature.
1173 * decl2.c (comdat_linkage, maybe_make_one_only): Update call to
1175 (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP.
1176 * method.c (use_thunk): Update call to make_decl_one_only.
1177 * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP
1179 2009-06-12 Aldy Hernandez <aldyh@redhat.com>
1181 * typeck.c (cp_build_binary_op): Pass location to overflow_warning.
1182 (build_modify_expr): New arg.
1183 * semantics.c (finish_unary_op_expr): Pass location to
1185 (handle_omp_for_class_iterator): Pass location to build_modify_expr.
1186 * typeck.c (cxx_sizeof_or_alignof_type): Pass location to
1187 c_sizeof_or_alignof_type.
1188 (build_array_ref): New argument.
1189 (build_compound_expr): Same.
1190 (build_const_cast): Same.
1191 (build_ptrmemfunc): Pass location to build_c_cast.
1192 * init.c (avoid_placement_new_aliasing): Pass location to
1194 (build_vec_delete_1): Pass location to cp_build_modify_expr,
1195 build_compound_expr.
1196 * class.c (build_vtbl_ref_1): Pass location to build_array_ref.
1197 * decl.c (poplevel): Pass location to c_build_bind_expr.
1198 (finish_case_label): Pass location to build_case_label.
1199 (finish_constructor_body): Same.
1200 (finish_destructor_body): Pass location to build_stmt.
1201 (cxx_maybe_build_cleanup): Same, but to build_compound_expr.
1202 * call.c (build_new_op): Pass location to build_array_ref.
1203 (build_x_va_arg): Pass location to build_va_arg.
1204 * except.c (expand_end_catch_block): Pass location to
1206 * cp-tree.h (build_array_ref): New argument.
1207 (build_compound_expr): Same.
1208 (build_c_cast): Same.
1209 * cp-gimplify.c (gimplify_if_stmt): Pass location on down.
1210 (gimplify_switch_stmt): Same.
1211 * typeck2.c (split_nonconstant_init_1): Same.
1212 * pt.c (tsubst_copy): Same.
1213 * semantics.c (add_decl_expr): Same.
1214 (do_poplevel): Same.
1215 (push_cleanup): Same.
1216 (finish_goto_stmt): Same.
1217 (finish_expr_stmt): Same.
1218 (begin_if_stmt): Same.
1219 (begin_while_stmt): Same.
1220 (begin_do_stmt): Same.
1221 (finish_return_stmt): Same.
1222 (begin_for_stmt): Same.
1223 (finish_break_stmt): Same.
1224 (finish_continue_stmt): Same.
1225 (begin_switch_stmt): Same.
1226 (begin_try_block): Same.
1227 (begin_handler): Same.
1228 (finish_asm_stmt): Same.
1229 (finish_label_stmt): Same.
1230 (finish_stmt_expr_expr): Same.
1231 (finalize_nrv_r): Same.
1232 (finish_omp_atomic): Same.
1233 * name-lookup.c (do_using_directive): Same.
1234 * decl2.c (grok_array_decl): Same.
1235 * parser.c (cp_parser_cast_expression): Same.
1236 (cp_parser_selection_statement): Same.
1237 (cp_parser_implicitly_scoped_statement): Same.
1238 (cp_parser_objc_selector_expression): Same.
1239 (cp_parser_objc_synchronized_statement): Same.
1240 (cp_parser_objc_throw_statement): Same.
1241 (cp_parser_omp_critical): Same.
1242 (cp_parser_omp_master): Same.
1243 * typeck.c (build_function_call): Add location argument.
1244 * init.c: Add location argument to all build_decl calls.
1250 * semantics.c: Same.
1253 * cp-gimplify.c: Same.
1255 (cp_make_fname_decl): Add location argument. Pass location ot
1257 (finish_case_label): Same.
1258 * cp-tree.h (finish_case_label): Add location argument.
1259 * parser.c (cp_parser_label_for_labeled_statement): Pass location to
1262 2009-06-09 Jason Merrill <jason@redhat.com>
1265 * decl2.c (mark_used): Return after complaining about deleted fn.
1267 2009-06-08 Jason Merrill <jason@redhat.com>
1269 * parser.c (cp_parser_type_id_1): 'auto' type is ok with a
1270 late-specified return type.
1272 2009-06-08 Jakub Jelinek <jakub@redhat.com>
1275 * call.c (check_dtor_name): Return false even if
1276 get_type_value (name) is error_mark_node.
1280 * parser.c (cp_parser_direct_declarator): Don't set TREE_SIDE_EFFECTS
1281 on error_mark_node. Check for VLAs outside of function context
1282 before check whether to wrap bounds into a NOP_EXPR with
1285 2009-06-08 Alexandre Oliva <aoliva@redhat.com>
1287 * repo.c (get_base_filename): Use aux_base_name rather than
1288 alternate temporary file during second compare debug compilation.
1289 (finish_repo): Skip during -fcompare-debug-second.
1291 2009-06-06 Ian Lance Taylor <iant@google.com>
1293 * parser.c (cp_parser_label_for_labeled_statement): Support
1294 attribute on labels if immediately followed by semicolon.
1295 * semantics.c (finish_label_stmt): Return new label.
1296 * pt.c (tsubst_expr): Handle attributes for LABEL_EXPR.
1298 2009-06-03 Ian Lance Taylor <iant@google.com>
1300 * Make-lang.in (cc1plus-checksum.o): Depend upon $(CONFIG_H) and
1303 2009-06-02 Mark Mitchell <mark@codesourcery.com>
1305 * decl.c (maybe_deduce_size_from_array_init): Use relayout_decl.
1307 2009-06-02 Jason Merrill <jason@redhat.com>
1311 * typeck.c (cp_build_modify_expr): Always pass init-lists to the
1313 * call.c (implicit_conversion): Allow init-list conversion to scalar
1314 during direct-initialization, too. Mark the conversion bad if it
1315 has too many levels of braces.
1316 (convert_like_real): And give a helpful error.
1320 * decl.c (cp_finish_decl): Handle auto deduction from ().
1321 * typeck.c (build_x_indirect_ref): Handle dereferencing an operand
1322 with dependent type that is known to be a pointer.
1324 2009-06-02 Simon Martin <simartin@users.sourceforge.net>
1327 * pt.c (register_specialization): Properly setup DECL_CONTEXT for
1328 specializations in an invalid namespace.
1330 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
1332 * error.c (print_instantiation_partial_context): Print column
1335 2009-05-29 Ian Lance Taylor <iant@google.com>
1337 * error.c (cp_printer): Don't use va_arg with enum type.
1339 2009-05-28 Dodji Seketeli <dodji@redhat.com>
1342 * cp-tree.h (canonical_type_variant): Remove this function declaration.
1343 (strip_typedefs): New function declaration.
1344 * tree.c (strip_typedefs): New function definition.
1345 (canonical_type_variant): Remove function definition.
1346 * cvt.c (convert_from_reference): No need to use
1347 canonical_type_variant.
1348 * typeck.c (cp_build_indirect_ref): Likewise.
1349 * error.c (dump_template_bindings): Use strip_typedefs instead of
1350 canonical_type_variant.
1351 * pt.c (convert_template_argument, unify): Likewise.
1352 * mangle.c (canonicalize_for_substitution): Don't use
1353 canonical_type_variant.
1355 2009-05-27 Jason Merrill <jason@redhat.com>
1357 * call.c (implicit_conversion): Handle conversion from
1358 initializer-list to scalar.
1359 (convert_like_real): Likewise. Avoid crashing on list
1360 initialization with bad conversions.
1361 (can_convert): Use LOOKUP_EXPLICIT.
1362 (can_convert_arg_bad): Add flags parm.
1363 * cp-tree.h: Adjust.
1364 * typeck.c (convert_for_assignment): Pass flags.
1366 2009-05-27 Ian Lance Taylor <iant@google.com>
1368 * Make-lang.in (g++$(exeext)): Change $(COMPILER) to $(LINKER).
1369 (cc1plus-dummy$(exeext), cc1plus$(exeext)): Likewise.
1371 2009-05-26 Ian Lance Taylor <iant@google.com>
1373 * Make-lang.in (g++spec.o): Use $(COMPILER).
1374 (g++$(exeext), cc1plus-dummy$(exeext)): Likewise.
1375 (cc1plus$(exeext)): Likewise.
1377 2009-05-26 Dodji Seketeli <dodji@redhat.com>
1380 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Remove this accessor.
1381 (TI_TYPEDEFS_NEEDING_ACCESS_CHECKING): New accessor.
1382 (get_types_needing_access_check): Declare new entry point.
1383 * pt.c (append_type_to_template_for_access_check_1,
1384 get_types_needing_access_check): New functions.
1385 (perform_typedefs_access_check): Accept FUNCTION_DECLs and
1386 RECORD_TYPEs rather than TEMPLATE_DECLs. Use the new
1387 get_types_needing_access_check, no more
1388 MEMBER_TYPES_NEEDING_ACCESS_CHECK.
1389 (instantiate_class_template): Set input_location to the source
1390 location of the most specialized template definition.
1391 Perform access check using the RECORD_TYPE of the template, not its
1392 associated most generic TEMPLATE_DECL.
1393 (append_type_to_template_for_access_check): Augment function
1394 comments. Use the new get_types_needing_access_check, not
1395 MEMBER_TYPE_NEEDING_ACCESS_CHECK. Use the new
1396 append_type_to_template_for_access_check_1 subroutine.
1398 2009-05-22 Jason Merrill <jason@redhat.com>
1401 * typeck.c (cp_build_binary_op): Allow ENUMERAL_TYPE in
1402 arithmetic comparisons.
1403 (cp_common_type): Handle scoped enums.
1405 * call.c (promoted_arithmetic_type_p): Don't use INTEGRAL_TYPE_P.
1406 (add_builtin_candidate, add_builtin_candidates): Likewise.
1407 (convert_like_real): Likewise.
1408 * class.c (check_bitfield_decl): Likewise.
1409 * decl.c (check_static_variable_definition): Likewise.
1410 (compute_array_index_type): Likewise.
1411 * decl2.c (grokbitfield): Likewise.
1412 * init.c (build_new_1): Likewise.
1413 * pt.c (convert_nontype_argument): Likewise.
1414 (current_instantiation): Likewise.
1415 * tree.c (pod_type_p): Likewise.
1416 * typeck.c (build_static_cast_1): Likewise.
1417 (build_reinterpret_cast_1): Likewise.
1419 2009-05-22 Richard Guenther <rguenther@suse.de>
1422 * init.c (avoid_placement_new_aliasing): Remove.
1423 (build_new_1): Do not call it.
1425 2009-05-22 Mark Mitchell <mark@codesourcery.com>
1427 * decl2.c (decl_needed_p): Consider dllexport'd functions needed.
1428 * semantics.c (expand_or_defer_fn): Similarly.
1430 2009-05-20 Ian Lance Taylor <iant@google.com>
1432 * parser.c (cp_parser_postfix_expression): Change args to a vec.
1433 Release it when done.
1434 (tree_vector): Define typedef. Define VEC functions.
1435 (cp_parser_parenthesized_expression_list): Change return type to
1436 vec. Change all callers.
1437 (cp_parser_new_expression): Change placement and initializer to
1438 vecs. Release them when done.
1439 (cp_parser_new_placement): Change return type to vec. Change all
1441 (cp_parser_new_initializer): Likewise.
1442 * typeck.c (build_function_call_vec): Just call
1443 cp_build_function_call_vec.
1444 (cp_build_function_call): Just build a vec and call
1445 cp_build_function_call_vec.
1446 (cp_build_function_call_vec): New function based on old
1447 cp_build_function_call.
1448 (convert_arguments): Remove nargs and argarray parameters. Change
1449 values to a vec. Change caller.
1450 (build_x_compound_expr_from_vec): New function.
1451 (cp_build_modify_expr): Build vec to pass to
1452 build_special_member_call.
1453 * call.c (struct z_candidate): Add first_arg field. Change args
1455 (convert_class_to_reference): Handle first argument separately.
1456 (add_candidate): Add first_arg parameter. Change args parameter
1457 to vec. Change all callers.
1458 (add_function_candidate, add_conv_candidate): Likewise.
1459 (add_template_candidate_real, add_template_candidate): Likewise.
1460 (add_template_conv_candidate): Likewise.
1461 (build_user_type_conversion_1): Handle first argument separately.
1462 (resolve_args): Change return type and parameter type to vecs.
1464 (perform_overload_resolution): Change args parameter to vec.
1466 (build_new_function_call, build_operator_new_call): Likewise.
1467 (add_candidates): Likewise.
1468 (build_op_call): New globally visible function, built from and
1469 replacing static function build_object_call.
1470 (build_new_op): Don't handle CALL_EXPR. Build vec, not tree_list,
1472 (build_op_delete_call): Build vec to pass to
1473 cp_build_function_call_vec.
1474 (build_temp): Build vec to pass to build_special_member_call.
1475 (convert_like_real): Likewise.
1476 (perform_direct_initialization_if_possible): Likewise.
1477 (build_over_call): Handle first_arg field. Use build_call_array
1478 rather than build_call_list.
1479 (build_special_member_call): Change args parameter to vec. Change
1481 (build_new_method_call): Likewise.
1482 * init.c (expand_default_init): Change parms to vec.
1483 (build_raw_new_expr): Change placement and init to vecs. Change
1485 (build_new_1, build_new): Likewise.
1486 * class.c (resolve_address_of_overloaded_function): Build array to
1487 pass to fn_type_unification.
1488 * pt.c (tsubst_copy_and_build): For NEW_EXPR build vecs to pass to
1489 build_new. For CALL_EXPR create a vec rather than a tree_list;
1490 expand a pack if necessary.
1491 (fn_type_unification): Change args parameter to const tree *. Add
1492 nargs parameter. Change all callers.
1493 (type_unification_real): Likewise.
1494 (unify): Build array to pass to type_unification_real.
1495 (get_bindings): Build array to pass to fn_type_unification.
1496 (any_type_dependent_arguments_p): Change args parameter to a vec.
1498 (make_args_non_dependent): Renamed from build_non_dependent_args.
1499 Change return type to void. Change parameter type to vec. Change
1501 (do_auto_deduction): Pass an array to type_unification_real.
1502 * semantics.c (perform_koenig_lookup): Change args to vec. Change
1504 (finish_call_expr): Change args to vec. Change all callers. Call
1505 build_op_call instead of passing CALL_EXPR to build_new_op.
1506 (cxx_omp_create_clause_info): Allocate vec to pass to
1507 build_special_member_call.
1508 * decl2.c (build_offset_ref_call_from_tree): Change args parameter
1509 to vec. Change all callers.
1510 * name-lookup.c (lookup_function_nonclass): Likewise.
1511 (struct arg_lookup): Change args to vec.
1512 (arg_assoc_namespace): Handle args as a vec.
1513 (arg_assoc_args_vec): New static function.
1514 (lookup_arg_dependent): Change args parameter to vec. Change all
1516 * method.c (do_build_assign_ref): Allocate vec to pass to
1517 build_special_member_call.
1518 * except.c (build_throw): Likewise.
1519 * typeck2.c (build_functional_cast): Likewise.
1520 * cvt.c (ocp_convert): Likewise.
1521 * tree.c (build_min_non_dep_call_vec): Change last parameter to
1522 vec. Change all callers.
1523 * cp-tree.h: Update declarations.
1524 * name-lookup.h: Update declarations.
1526 2009-05-20 Sandra Loosemore <sandra@codesourcery.com>
1528 * typeck.c (default_conversion): Check targetm.promoted_type.
1529 * decl.c (grokdeclarator): Check targetm.invalid_return_type.
1530 (grokparms): Check targetm.invalid_parameter_type.
1531 * cvt.c (ocp_convert): Check targetm.convert_to_type.
1532 (build_expr_type_conversion): Check targetm.promoted_type.
1534 2009-05-19 Andrew Pinski <andrew_pinski@playstation.sony.com>
1536 * typeck.c (build_binary_op): Allow % on integal vectors.
1538 2009-05-18 Jason Merrill <jason@redhat.com>
1540 Implement explicit conversions ops as specified in N2437.
1541 * decl.c (grokdeclarator): Handle explicit conversion ops.
1542 (check_initializer): Pass flags to store_init_value.
1543 * decl2.c (maybe_emit_vtables): Likewise.
1544 * init.c (expand_aggr_init_1): Likewise.
1545 * call.c (convert_class_to_reference): Take flags parm,
1546 check DECL_NONCONVERTING_P.
1547 (build_user_type_conversion_1): Check DECL_NONCONVERTING_P.
1548 (add_builtin_candidates): Simplify getting type of conversion.
1549 (build_object_call): Likewise. Check DECL_NONCONVERTING_P.
1550 (implicit_conversion): Pass through LOOKUP_ONLYCONVERTING.
1551 (reference_binding): Take flags parm. Direct-initialize copy parm.
1552 (add_function_candidate): Direct-initialize the copy parm.
1553 (add_conv_candidate): Use LOOKUP_IMPLICIT, not LOOKUP_NORMAL.
1554 (build_builtin_candidate): Add LOOKUP_ONLYCONVERTING.
1555 (conditional_conversion): Likewise.
1556 (convert_like_real): Only complain about DECL_NONCONVERTING_P
1558 (perform_implicit_conversion_flags): Add flags parm to
1559 perform_implicit_conversion. Improve diagnostics.
1560 * cp-tree.h (LOOKUP_IMPLICIT): New macro.
1561 (LOOKUP_COPY_PARM): New bit macro.
1562 * cvt.c (build_expr_type_conversion): Check DECL_NONCONVERTING_P.
1563 * typeck.c (convert_for_assignment): Take flags parm, pass it to
1564 perform_implicit_conversion_flags.
1565 (cp_build_modify_expr): Pass flags to convert_for_assignment.
1566 (convert_for_initialization): Likewise.
1567 * typeck2.c (store_init_value): Take flags parm, pass to
1569 (digest_init_flags): Add flags parm to digest_init.
1570 (digest_init_r): Take flags parm, pass to convert_for_initialization.
1571 (process_init_constructor_array): Pass it.
1572 (process_init_constructor_record): Likewise.
1573 (process_init_constructor_union): Likewise.
1575 2009-05-16 Jason Merrill <jason@redhat.com>
1578 * pt.c (tsubst_qualified_id): Retain the type if we aren't dealing
1579 with a dependent type. Actually look up the destructor.
1580 * semantics.c (finish_id_expression): Fix logic.
1581 (finish_qualified_id_expr): Don't try to use 'this' if we aren't in
1583 * typeck.c (build_x_unary_op): Diagnose taking the address of a
1584 constructor or destructor.
1585 * tree.c (get_first_fn): Handle OFFSET_REF.
1587 2009-05-17 Joseph Myers <joseph@codesourcery.com>
1589 * tree.c (cxx_printable_name_internal): Allow consecutive
1590 translated and untranslated cached copies of the name of the
1593 2009-05-15 Ian Lance Taylor <iant@google.com>
1595 * cp-tree.h (enum cp_lvalue_kind_flags): Rename from
1596 cp_lvalue_kind. Change all uses.
1597 (enum base_access_flags): Rename from enum base_access. Change
1599 * parser.c (enum cp_parser_flags): Remove enum tag.
1601 2009-05-15 Manuel López-Ibáñez <manu@gcc.gnu.org>
1604 * call.c (build_new_op): Update calls to warn_logical_operator.
1606 2009-05-14 Ian Lance Taylor <iant@google.com>
1608 * class.c (layout_class_type): Change itk to unsigned int.
1609 * decl.c (finish_enum): Change itk to unsigned int.
1610 * parser.c (cp_parser_check_decl_spec): Change ds to int. Remove
1613 2009-05-13 David Mandelin <dmandelin@mozilla.com>:
1615 * decl.c (duplicate_decls): Preserve parameter attributes.
1617 2009-05-10 Jan Hubicka <jh@suse.cz>
1619 * decl2.c (cxx_callgraph_analyze_expr): Use
1620 cgraph_mark_address_taken.
1622 2009-05-10 Joseph Myers <joseph@codesourcery.com>
1624 * call.c (name_as_c_string): Call type_as_string_translate.
1625 Translate identifiers to locale character set.
1626 * cp-tree.h (lang_decl_name): Update prototype.
1627 (type_as_string_translate, decl_as_string_translate,
1628 cxx_printable_name_translate): Declare.
1629 * cxx-pretty-print.c (M_): Define.
1630 (pp_cxx_unqualified_id, pp_cxx_canonical_template_parameter): Mark
1631 English fragments for conditional translation with M_.
1632 * decl.c (grokdeclarator): Translate identifiers to locale
1633 character set for diagnostics.
1634 * error.c (M_): Define.
1635 (dump_template_bindings, dump_type, dump_aggr_type,
1636 dump_type_prefix, dump_global_iord, dump_simple_decl, dump_decl,
1637 dump_function_decl, dump_template_parms, dump_expr,
1638 dump_binary_op, op_to_string, assop_to_string): Mark English
1639 fragments for conditional translation with M_.
1640 (type_as_string): Disable translation of identifiers.
1641 (type_as_string_translate): New.
1642 (expr_as_string): Disable translation of identifiers.
1643 (decl_as_string): Disable translation of identifiers.
1644 (decl_as_string_translate): New.
1645 (lang_decl_name): Add parameter translate.
1646 (args_to_string): Call type_as_string_translate.
1647 (cp_print_error_function): Call cxx_printable_name_translate.
1648 (print_instantiation_full_context,
1649 print_instantiation_partial_context): Call
1650 decl_as_string_translate.
1651 * parser.c (cp_lexer_get_preprocessor_token): Use %qE for
1652 identifier in diagnostic.
1653 * tree.c (cxx_printable_name): Change to
1654 cxx_printable_name_internal. Add parameter translate.
1655 (cxx_printable_name, cxx_printable_name_translate): New wrappers
1656 round cxx_printable_name_internal.
1658 2009-05-08 H.J. Lu <hongjiu.lu@intel.com>
1661 * call.c (build_call_a): Updated warn_deprecated_use call.
1662 (build_over_call): Likewise.
1663 * decl.c (grokdeclarator): Likewise.
1664 (grokparms): Likewise.
1665 * semantics.c (finish_id_expression): Likewise.
1666 * typeck.c (build_class_member_access_expr): Likewise.
1667 (finish_class_member_access_expr): Likewise.
1669 2009-05-06 Dodji Seketeli <dodji@redhat.com>
1672 * pt.c (tsubst_copy) <case PARM_DECL>: We don't want to tsubst the
1673 whole list of PARM_DECLs, just the current one.
1675 2009-05-05 Shujing Zhao <pearly.zhao@oracle.com>
1678 (opname_tab, assignop_tab, update_member_visibility, yyerror, yyhook,
1679 mangle_compound_literal): Remove unused declarations.
1680 (build_vfield_ref, cxx_print_statistics, clone_function_decl,
1681 adjust_clone_args, maybe_push_cleanup_level, pushtag, make_anon_name,
1682 pushdecl_top_level_maybe_friend, pushdecl_top_level_and_finish,
1683 check_for_out_of_scope_variable, print_other_binding_stack,
1684 maybe_push_decl, cxx_mark_addressable, force_target_expr,
1685 build_target_expr_with_type, finish_case_label,
1686 cxx_maybe_build_cleanup, begin_eh_spec_block, finish_eh_spec_block,
1687 check_template_keyword, cxx_omp_predetermined_sharing,
1688 cxx_omp_clause_default_ctor, cxx_omp_clause_copy_ctor,
1689 cxx_omp_clause_assign_op, cxx_omp_clause_dtor, cxx_omp_finish_clause,
1690 cxx_omp_privatize_by_reference): Rearrange the declarations line to
1691 match the comment that indicates the .c file which the functions are
1693 (cxx_print_xnode, cxx_print_decl, cxx_print_type,
1694 cxx_print_identifier, cxx_print_error_function, pushdecl): Add comment.
1696 2009-05-05 Nathan Sidwell <nathan@codesourcery.com>
1698 * typeck.c (cp_build_compound_expr): Require RHS to have a known
1700 * class.c (resolve_address_of_overloaded_function): Use
1701 OVL_CURRENT for error message.
1702 (instantiate_type): Forbid COMPOUND_EXPRs and remove code dealing
1703 with them. Do not copy the node.
1705 2009-05-05 Jakub Jelinek <jakub@redhat.com>
1708 * pt.c (tsubst): If magic NOP_EXPR with side-effects has no type,
1709 set it from its operand's type after tsubst_expr.
1711 2009-05-04 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1714 * parser.c (cp_lexer_get_preprocessor_token): Do not store the
1715 canonical spelling for keywords.
1716 (cp_parser_attribute_list): Use the canonical spelling for
1717 keywords in attributes.
1719 2009-05-01 Joseph Myers <joseph@codesourcery.com>
1721 * cxx-pretty-print.c (is_destructor_name, pp_cxx_unqualified_id,
1722 pp_cxx_template_keyword_if_needed, pp_cxx_postfix_expression,
1723 pp_cxx_new_expression, pp_cxx_delete_expression,
1724 pp_cxx_unary_expression, pp_cxx_assignment_operator,
1725 pp_cxx_assignment_expression, pp_cxx_expression,
1726 pp_cxx_function_specifier, pp_cxx_decl_specifier_seq,
1727 pp_cxx_simple_type_specifier, pp_cxx_type_specifier_seq,
1728 pp_cxx_exception_specification, pp_cxx_direct_declarator,
1729 pp_cxx_ctor_initializer, pp_cxx_type_id, pp_cxx_statement,
1730 pp_cxx_namespace_alias_definition, pp_cxx_template_parameter,
1731 pp_cxx_canonical_template_parameter, pp_cxx_template_declaration,
1732 pp_cxx_declaration, pp_cxx_typeid_expression,
1733 pp_cxx_va_arg_expression, pp_cxx_offsetof_expression,
1734 pp_cxx_trait_expression): Mostly use pp_string and
1735 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1736 for non-identifiers. Mark English strings for translation.
1737 * cxx-pretty-print.h (pp_cxx_ws_string): Define.
1738 * error.c (dump_template_parameter, dump_template_bindings,
1739 dump_type, dump_aggr_type, dump_type_prefix, dump_simple_decl,
1740 dump_decl, dump_template_decl, dump_function_decl,
1741 dump_parameters, dump_exception_spec, dump_template_parms,
1742 dump_expr, dump_binary_op, dump_unary_op, op_to_string,
1743 assop_to_string, args_to_string, cp_print_error_function,
1744 print_instantiation_full_context,
1745 print_instantiation_partial_context): Mostly use pp_string and
1746 pp_cxx_ws_string in place of pp_identifier and pp_cxx_identifier
1747 for non-identifiers. Mark English strings for translation.
1748 (dump_global_iord): Mark strings for translation; use longer
1749 strings instead of substituting single words.
1750 (function_category): Return a format string marked for
1751 translation, not a single word or phrase to substitute in a longer
1754 2009-04-28 Ben Elliston <bje@au.ibm.com>
1759 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1761 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
1763 2009-04-27 Ian Lance Taylor <iant@google.com>
1765 * semantics.c (finish_omp_clauses): Change type of c_kind to enum
1768 2009-04-27 Jakub Jelinek <jakub@redhat.com>
1771 * cvt.c (convert_to_void) <case INDIRECT_REF>: Only warn about
1772 -Wunused-value if implicit.
1774 2009-04-24 Ian Lance Taylor <iant@google.com>
1776 * call.c (build_temp): Change 0 to enum constant.
1777 * cp-tree.h (cp_lvalue_kind): Typedef to int rather than enum
1779 * cp-gimplify.c (cp_gimplify_expr): Add cast to enum type.
1780 * decl2.c (constrain_visibility): Likewise.
1781 * parser.c (cp_lexer_get_preprocessor_token): Likewise.
1782 (cp_parser_flags): Typedef to int rather than enum type.
1783 (cp_parser_expression_stack_entry): Change prec field to enum
1786 * typeck.c (build_modify_expr): Add lhs_origtype parameter.
1789 2009-04-22 Dodji Seketeli <dodji@redhat.com>
1792 * parser.c (cp_parser_template_argument_list): Display an error
1793 when an ellipsis is not preceded by a parameter pack. Also, warn
1794 about variadic templates usage without -std=c++0x.
1796 2009-04-21 Taras Glek <tglek@mozilla.com>
1798 * cp-tree.h: Update GTY annotations to new syntax.
1800 * mangle.c: Likewise.
1801 * name-lookup.c: Likewise.
1802 * name-lookup.h: Likewise.
1803 * parser.c: Likewise.
1806 * semantics.c: Likewise.
1807 * typeck2.c: Likewise.
1809 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1812 * parser.c (cp_parser_error): Pass token->flags to c_parse_error.
1814 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1817 * typeck.c (check_for_casting_away_constness): We diagnose casting
1818 away any qualifiers not just constness.
1819 (casts_away_constness): Mention that it handles more than just
1822 2009-04-21 Joseph Myers <joseph@codesourcery.com>
1824 * ChangeLog, ChangeLog-1993, ChangeLog-1994, ChangeLog-1995,
1825 ChangeLog-1996, ChangeLog-1997, ChangeLog-1998, ChangeLog-1999,
1826 ChangeLog-2000, ChangeLog-2001, ChangeLog-2002, ChangeLog-2003,
1827 ChangeLog-2004, ChangeLog-2005, ChangeLog-2006, ChangeLog-2007,
1828 ChangeLog-2008, ChangeLog.ptr, ChangeLog.tree-ssa, NEWS,
1829 cfns.gperf: Add copyright and license notices.
1830 * cfns.h: Regenerate.
1831 * ChangeLog, ChangeLog-2004: Correct dates.
1833 2009-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
1836 * tree.c (lvalue_p_1): Use const_tree.
1837 Use CONST_CAST_TREE to avoid warning.
1838 (lvalue_p): Returns bool, receives const_tree.
1840 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1843 * parser.c (cp_parser_check_decl_spec): Drop redundant flags.
1844 * error.c (pedwarn_cxx98): New.
1845 * cp-tree.h (pedwarn_cxx98): Declare.
1847 2009-04-20 Le-Chun Wu <lcwu@google.com>
1850 * init.c (build_vec_init): Set TREE_NO_WARNING on the
1851 compiler-generated INDIRECT_REF expression.
1853 2009-04-20 Ian Lance Taylor <iant@google.com>
1855 * typeck.c (build_function_call_vec): New function.
1856 (cp_build_function_call): Only pass first parameter to
1857 objc_rewrite_function_call.
1858 (build_modify_expr): Add rhs_origtype parameter. Change all
1860 * decl.c (finish_decl): Add origtype parameter. Change all
1862 * semantics.c (finish_call_expr): Pass VEC to
1863 resolve_overloaded_builtin.
1865 2009-04-20 Ian Lance Taylor <iant@google.com>
1867 * cp-tree.h (base_access): Change typedef to int.
1868 * parser.c (cp_parser_omp_flush): Change 0 to OMP_CLAUSE_ERROR.
1869 (cp_parser_omp_threadprivate): Likewise.
1870 * pt.c (unify_pack_expansion): Add casts to enum type.
1872 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org>
1876 * call.c (build_new_op): Save the original codes of operands
1879 2009-04-18 Kazu Hirata <kazu@codesourcery.com>
1881 * cp-tree.h: Remove the prototype for insert_block.
1882 * decl.c (insert_block): Remove.
1884 2009-04-16 Ian Lance Taylor <iant@google.com>
1886 * cp-tree.h (enum tsubst_flags): Rename from enum tsubst_flags_t.
1887 (tsubst_flags_t): Change typedef from enum type to int.
1889 2009-04-16 Paolo Bonzini <bonzini@gnu.org>
1891 * decl.c (check_initializer): Use TYPE_VECTOR_OPAQUE
1892 instead of targetm.vector_opaque_p.
1894 2009-04-15 Le-Chun Wu <lcwu@google.com>
1897 * call.c (build_over_call): Set TREE_NO_WARNING on the
1898 compiler-generated INDIRECT_REF expression.
1899 * cvt.c (convert_to_void): Emit warning when stripping off
1902 2009-04-14 Diego Novillo <dnovillo@google.com>
1904 * parser.c (cp_parser_type_specifier_seq): Move call to
1905 invoke_plugin_callbacks ...
1906 (cp_parser_type_specifier_seq): ... here.
1908 2009-04-14 Le-Chun Wu <lcwu@google.com>
1910 * Make-lang.in: Modify dependencies of files including plugin.h.
1911 * decl.c (finish_function): Call invoke_plugin_callbacks.
1912 * parser.c (cp_parser_type_specifier): Call invoke_plugin_callbacks.
1914 2009-04-14 Jason Merrill <jason@redhat.com>
1917 * name-lookup.c (pushdecl_maybe_friend): Avoid all warnings
1918 about shadowing by tentative parms.
1920 2009-04-13 Jason Merrill <jason@redhat.com>
1923 * call.c (build_over_call): Don't call memcpy if the target is
1924 the same as the source.
1926 2009-04-13 Jason Merrill <jason@redhat.com>
1929 * pt.c (uses_template_parms): Handle CONSTRUCTOR.
1931 2009-04-12 Jason Merrill <jason@redhat.com>
1934 * call.c (joust): Don't crash on variadic fn.
1936 2009-04-10 Jason Merrill <jason@redhat.com>
1939 * parser.c (cp_parser_skip_to_end_of_block_or_statement): Return
1940 if we see a close brace without an open brace.
1942 2009-04-10 H.J. Lu <hongjiu.lu@intel.com>
1944 * parser.c (cp_parser_class_specifier): Remove the unused
1945 has_trailing_semicolon.
1947 2009-04-10 Manuel López-Ibáñez <manu@gcc.gnu.org>
1950 * parser.c (cp_parser_check_template_parameters): Take a
1951 cp_declarator parameter.
1952 (cp_parser_elaborated_type_specifier): Update to
1953 cp_parser_check_template_parameters.
1954 (cp_parser_class_head): Likewise.
1955 (cp_parser_check_declarator_template_parameters): Likewise.
1956 (cp_parser_check_template_parameters): Handle first the non-error
1957 conditions. Give more accurate diagnostics if a declarator is
1960 2009-04-08 Jason Merrill <jason@redhat.com>
1963 * error.c (dump_aggr_type): Chase template typedefs if
1964 -fno-pretty-templates.
1966 2009-04-08 Dodji Seketeli <dodji@redhat.com>
1969 * parser.c (cp_parser_enumerator_definition): Make sure the
1970 initializer of the enumerator doesn't contain any bare parameter pack.
1972 2009-04-07 Jason Merrill <jason@redhat.com>
1975 * name-lookup.c (merge_functions): Keep multiple extern "C" functions.
1976 * call.c (joust): Complain about mismatched default arguments
1977 in extern "C" functions.
1978 * class.c (resolve_address_of_overloaded_function): Handle multiple
1979 extern "C" functions.
1980 * pt.c (resolve_overloaded_unification): Likewise.
1982 2009-04-07 Jason Merrill <jason@redhat.com>
1985 * error.c (dump_function_decl): Don't pretty-print templates
1986 if -fno-pretty-templates.
1987 (count_non_default_template_args): Print all args if
1988 -fno-pretty-templates.
1990 2009-04-06 Jason Merrill <jason@redhat.com>
1993 * pt.c (fn_type_unification): For DEDUCE_EXACT check that
1994 the deduced template arguments give us the parameter types
1997 2009-04-05 Giovanni Bajo <giovannibajo@libero.it>
1998 Jason Merrill <jason@redhat.com>
2001 * error.c (count_non_default_template_args): New fn.
2002 (dump_template_parms): Call it.
2003 (dump_template_argument_list): Call it. Add parms parm.
2004 (dump_template_argument): Adjust call to dump_template_argument_list.
2005 (dump_type, dump_decl): Likewise.
2006 (dump_template_bindings): Refactor logic.
2008 2009-04-03 Jason Merrill <jason@redhat.com>
2011 * error.c (dump_template_bindings): Look through typedefs in
2013 (dump_type) [TYPENAME_TYPE]: Print the typedef name if any.
2014 (find_typenames_r): Also collect typedefs.
2015 * pt.c (unify): Strip typedefs.
2018 * semantics.c (finish_id_expression): Don't assume a dependent
2019 member of the current instantiation isn't a valid integral
2020 constant expression. Check dependent_scope_p.
2021 * pt.c (dependent_scope_p): Check TYPE_P.
2022 (tsubst_copy): If args is null, just return.
2024 2009-04-02 Jason Merrill <jason@redhat.com>
2027 * error.c (find_typenames, find_typenames_r): New fns.
2028 (dump_function_decl): Call find_typenames.
2029 (dump_template_bindings): Print typenames as well.
2030 * pt.c (tsubst): Non-static.
2031 * cp-tree.h: Declare it.
2033 2009-04-02 Dodji Seketeli <dodji@redhat.com>
2036 * decl2.c (grokfield): when a typedef appears in a
2037 class, create the typedef variant type node for it.
2038 (save_template_attributes): Creating typedef variant type node
2039 here is now useless.
2040 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2041 anonymous, set the proper type name to all its type variants.
2042 (xref_basetypes) : Fixup the variant types after setting
2044 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2045 set_underlying_type function to install typedef variant types.
2046 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2048 (append_type_to_template_for_access_check): New entry points.
2049 * semantics.c (check_accessibility_of_qualified_id):
2050 When a typedef that is a member of a class appears in a template,
2051 add it to the template. It will be ...
2052 * class.c (finish_struct_bits): Split type variant fixup into ...
2053 (fixup_type_variants): A new entry point.
2054 * pt.c (instantiate_class_template, instantiate_template ): ... access
2055 checked at template instantiation time.
2056 (resolve_type_name_type): The type name should be the name of the
2058 (retrieve_specialization): Specializations of template typedefs aren't
2059 to looked up in DECL_TEMPLATE_INSTANTIATIONS (tmpl).
2060 (append_type_to_template_for_access_check): New entry point.
2061 (tsubst_decl): For typedefs, build the variant type from the correct
2063 (get_class_bindings): Fix function comment.
2064 (perform_typedefs_access_check): New entry point.
2066 2009-03-31 Jason Merrill <jason@redhat.com>
2069 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
2070 extern "C" declarations.
2073 * semantics.c (finish_non_static_data_member): Allow such references
2074 without an associated object in sizeof/decltype/alignof.
2076 * ptree.c (cxx_print_decl): Pretty-print full name of
2078 (cxx_print_type): Pretty-print full name of class.
2080 * decl.c (grokdeclarator): Reject pointer to qualified function
2083 PR c++/37806, core issue 547
2084 * typeck.c (cp_apply_type_quals_to_decl): Don't apply any quals
2086 * tree.c (cp_build_qualified_type_real): Don't apply restrict to a
2088 * decl.h (enum decl_context): Add TEMPLATE_TYPE_ARG.
2089 * decl.c (groktypename): Add is_template_arg parameter.
2090 (grokdeclarator): Allow function cv-quals on a template type arg.
2091 * parser.c (cp_parser_new_type_id, cp_parser_type_id): Add
2092 is_template_arg argument in calls to groktypename.
2093 * cp-tree.h: Adjust prototype.
2094 * error.c (dump_type_prefix, dump_type_suffix): Fix plain
2095 FUNCTION_TYPE printing.
2097 * mangle.c (write_expression): Mangle dependent name as
2100 PR c++/38030, 38850, 39070
2101 * pt.c (type_dependent_expression_p_push): New fn.
2102 (tsubst_copy_and_build) [CALL_EXPR]: Only do arg-dep lookup when the
2103 substitution makes the call non-dependent. Preserve koenig_p.
2104 * parser.c (cp_parser_postfix_expression): Only do arg-dep lookup
2105 for non-dependent calls.
2106 * semantics.c (finish_call_expr): Revert earlier changes.
2107 * cp-tree.h: Revert change to finish_call_expr prototype.
2109 2009-03-29 Joseph Myers <joseph@codesourcery.com>
2111 PR preprocessor/34695
2112 * cp-tree.h (cp_cpp_error): Remove.
2113 * error.c (cp_cpp_error): Remove.
2114 * parser.c (cp_lexer_new_main): Set done_lexing instead of
2115 client_diagnostic and error callback.
2117 2009-03-28 Paolo Bonzini <bonzini@gnu.org>
2119 * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
2120 * cp/cp-objcp-common.c (cxx_staticp): Remove.
2121 * cp/cp-tree.h (cxx_staticp): Remove.
2123 2009-03-28 Jakub Jelinek <jakub@redhat.com>
2126 * parser.c (cp_parser_postfix_expression): Don't call
2127 warning_if_disallowed_function_p.
2129 2009-03-27 Jan Hubicka <jh@suse.cz>
2131 * except.c (choose_personality_routine): Set terminate_node to abort
2132 for java exceptions.
2134 2009-03-27 Dodji Seketeli <dodji@redhat.com>
2135 Jakub Jelinek <jakub@redhat.com>
2138 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_EXPLICIT_P): Define.
2139 (cp_function_decl_explicit_p): New prototype.
2140 * cp-objcp-common.c (cp_function_decl_explicit_p): New function.
2142 2009-03-27 Andrew Pinski <andrew_pinski@playstation.sony.com>
2145 * parser.c (cp_parser_elaborated_type_specifier): If we have a
2146 typename tag and don't have either a TYPE_DECL or a
2147 TEMPLATE_ID_EXPR, set the type to NULL.
2149 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2152 * decl.c (grokdeclarator): Reject [con|de]stuctors in a non-class
2155 2009-03-27 Simon Martin <simartin@users.sourceforge.net>
2158 * decl.c (check_array_designated_initializer): Handle error_mark_node.
2160 2009-03-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2163 * typeck.c (cp_pointer_sum): Adjust call to pointer_int_sum.
2165 2009-03-26 Andrew Haley <aph@redhat.com>
2168 * decl2.c (possibly_inlined_p): If java exceptions are in use
2169 don't inline a decl unless it is explicitly marked inline.
2170 * lex.c: (pragma_java_exceptions): New variable.
2171 (handle_pragma_java_exceptions): Set pragma_java_exceptions.
2172 * cp-tree.h (pragma_java_exceptions): Declare new variable.
2174 2009-03-24 Jason Merrill <jason@redhat.com>
2177 * name-lookup.c (pushdecl_maybe_friend): Check default args later.
2179 2009-03-23 Jakub Jelinek <jakub@redhat.com>
2182 * semantics.c (handle_omp_for_class_iterator): Swap cond operands and
2183 code if iter is the second operand.
2184 * parser.c (cp_parser_binary_expression): Add no_toplevel_fold_p
2185 argument. If it is set, don't build the toplevel expression with
2186 build_x_binary_op, but build2.
2187 (cp_parser_assignment_expression, cp_parser_omp_for_incr): Adjust
2189 (cp_parser_omp_for_cond): Don't assume the first operand of the
2190 comparison must be decl.
2192 2009-03-23 Jason Merrill <jason@redhat.com>
2195 * pt.c (make_fnparm_pack): Split out from...
2196 (instantiate_decl): ...here.
2197 (tsubst_pack_expansion): Handle being called in a late-specified
2201 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
2204 2009-03-20 Jason Merrill <jason@redhat.com>
2207 * parser.c (cp_parser_direct_declarator): In a template, wrap
2208 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
2209 * pt.c (tsubst): Preserve it in a partial instantiation.
2210 (dependent_type_p_r): Don't check value_dependent_expression_p.
2211 * decl.c (compute_array_index_type): Don't check
2212 value_dependent_expression_p if TREE_SIDE_EFFECTS.
2215 * typeck2.c (check_narrowing): Don't complain about loss of
2216 precision when converting a floating-point constant.
2218 2009-03-19 Jakub Jelinek <jakub@redhat.com>
2221 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
2222 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
2224 2009-03-18 Jakub Jelinek <jakub@redhat.com>
2226 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
2227 (eof_token): Adjust.
2229 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
2232 * parser.c (cp_parser_explicit_specialization): Don't skip the
2233 rest of the specialization when begin_specialization returns
2236 2009-03-17 Jason Merrill <jason@redhat.com>
2238 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
2239 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
2240 * pt.c (check_explicit_specialization): Likewise.
2241 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
2242 local specialization.
2243 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
2244 * decl2.c (parm_index): New fn.
2245 * semantics.c (finish_decltype_type): Don't use describable_type.
2246 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
2247 Give a sorry for unsupported codes rather than crash. Mangle
2248 conversions with other than 1 operand. New mangling for PARM_DECL.
2249 * operators.def (ALIGNOF_EXPR): Mangle as "az".
2251 2009-03-17 Jing Yu <jingyu@google.com>
2254 * method.c (use_thunk): Change is_thunk from crtl to cfun.
2256 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
2259 * semantics.c (check_trait_type): New.
2260 (finish_trait_expr): Use it.
2262 2009-03-17 Jakub Jelinek <jakub@redhat.com>
2264 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
2265 instead of calling imported_module_or_decl debug hook if
2266 building_stmt_tree ().
2267 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
2268 is a NAMESPACE_DECL.
2271 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
2272 hook at function scope.
2275 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
2278 2009-03-09 Jakub Jelinek <jakub@redhat.com>
2281 * semantics.c (finish_switch_cond): Don't call get_unwidened.
2282 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
2283 instead of TREE_TYPE (cond).
2285 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
2288 * parser.c (cp_parser_late_parsing_default_args): Continue
2289 the loop when cp_parser_assignment_expression returns
2292 2009-03-07 Jason Merrill <jason@redhat.com>
2295 * init.c (build_new_1): Don't use a VLA type.
2296 (build_vec_init): Handle getting a pointer for BASE.
2298 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
2301 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
2302 when mangling symbols.
2304 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
2307 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
2309 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
2311 * decl.c (record_builtin_java_type): Use canonicalized integer
2314 2009-03-04 Jason Merrill <jason@redhat.com>
2317 * class.c (is_really_empty_class): New fn.
2318 * cp-tree.h: Declare it.
2319 * cp-objcp-common.c (cp_expr_size): Use it.
2322 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
2323 * parser.c (cp_parser_postfix_expression): Call it for
2325 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
2326 (get_first_fn): Likewise.
2332 * decl.c (make_typename_type): Do look inside currently open classes.
2333 * parser.c (cp_parser_lookup_name): Likewise.
2334 (cp_parser_template_name): Likewise.
2335 * pt.c (dependent_scope_p): New function.
2336 * cp-tree.h: Declare it.
2337 * class.c (currently_open_class): Return fast if T isn't a class.
2339 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
2342 * parser.c (cp_parser_mem_initializer): Return error_mark_node
2343 if cp_parser_mem_initializer_id returns error_mark_node.
2345 2009-02-24 Richard Guenther <rguenther@suse.de>
2348 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
2351 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
2354 * pt.c (coerce_template_template_parms): Return 0 if parameter
2357 2009-02-23 Jason Merrill <jason@redhat.com>
2359 * pt.c (unify): Call maybe_adjust_types_for_deduction when
2360 deducing from an initializer list.
2362 2009-02-20 Jason Merrill <jason@redhat.com>
2365 * decl.c (grokdeclarator): Handle ~identifier.
2367 2009-02-19 Jakub Jelinek <jakub@redhat.com>
2370 * decl2.c (determine_visibility): If visibility changed and
2371 DECL_RTL has been already set, call make_decl_rtl to update symbol
2374 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
2377 * cp-tree.h (maybe_commonize_var): New.
2379 * decl.c (maybe_commonize_var): Make it extern.
2381 * decl2.c (finish_anon_union): Call maybe_commonize_var.
2383 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
2386 * parser.c (cp_parser_enum_specifier): Apply all attributes.
2388 2009-02-18 Jason Merrill <jason@redhat.com>
2390 * cfns.h: Tweak pathname for cfns.gperf.
2392 2009-02-13 Jason Merrill <jason@redhat.com>
2395 * semantics.c (finish_call_expr): Change koenig_p parm to int.
2396 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
2397 * cp-tree.h: Adjust prototype.
2398 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
2400 2009-02-12 Jason Merrill <jason@redhat.com>
2403 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
2405 2009-02-11 Jason Merrill <jason@redhat.com>
2408 * decl2.c (cp_write_global_declarations):
2409 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
2412 * init.c (build_value_init_noctor): Split out from...
2413 (build_value_init): ...here.
2414 (expand_aggr_init_1): Handle value-initialization.
2415 * cp-tree.h: Add declaration.
2416 * class.c (type_has_user_provided_constructor):
2417 Handle non-class arguments.
2419 2009-02-10 Jason Merrill <jason@redhat.com>
2422 * class.c (defaultable_fn_p): Handle ... properly.
2425 * tree.c (lvalue_p_1): Condition rvalue ref handling on
2426 treat_class_rvalues_as_lvalues, too.
2428 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
2431 * typeck.c (build_x_array_ref): New.
2432 * cp-tree.h: Declare it.
2433 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
2435 2009-02-09 Jason Merrill <jason@redhat.com>
2438 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
2439 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
2440 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
2441 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
2442 for build_value_init TARGET_EXPR.
2443 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
2445 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
2449 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
2451 2009-02-04 Jakub Jelinek <jakub@redhat.com>
2454 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
2455 remove ./dt operator.
2456 * mangle.c (write_expression): Handle COMPONENT_REF after handling
2457 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
2458 write_string ("dt") instead of using operators.def.
2460 2009-02-03 Jason Merrill <jason@redhat.com>
2462 * typeck.c (cp_build_unary_op): Only complain about taking address
2463 of main if pedantic.
2465 2009-02-03 Jakub Jelinek <jakub@redhat.com>
2468 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
2471 * typeck2.c (digest_init_r): Don't call process_init_constructor
2474 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
2477 * pt.c (convert_nontype_argument_function): Expect expr to be an
2481 * typeck.c (merge_types): Call resolve_typename_type if only
2482 one type is a typename.
2484 2009-02-02 Jason Merrill <jason@redhat.com>
2487 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
2490 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
2493 * parser.c (cp_parser_pure_specifier): If there are no tokens left
2494 do not call cp_lexer_consume_token.
2496 2009-01-30 Jakub Jelinek <jakub@redhat.com>
2499 * parser.c (cp_parser_already_scoped_statement): Handle __label__
2502 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2505 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
2507 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
2510 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
2512 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
2514 * typeck.c (invalid_nonstatic_memfn_p): Use
2515 DECL_NONSTATIC_MEMBER_FUNCTION_P.
2517 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
2520 * call.c (build_over_call): If convert_for_arg_passing returns
2521 error_mark_node unconditionally return it.
2523 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
2525 * class.c (check_field_decls): Also inherit packed for bitfields
2526 regardless of their type.
2528 2009-01-22 Dodji Seketeli <dodji@redhat.com>
2531 * decl2.c (grokfield): Reverting changes of PR c++/26693
2532 (save_template_attributes): Likewise.
2533 * decl.c (grokdeclarator): Likewise.
2534 * name-lookup.c (pushdecl_maybe_friend): Likewise.
2535 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
2536 (append_type_to_template_for_access_check): Likewise.
2537 * semantics.c (check_accessibility_of_qualified_id): Likewise.
2538 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
2540 (resolve_type_name_type): Likewise.
2541 (append_type_to_template_for_access_check): Likewise.
2543 2009-01-21 Dodji Seketeli <dodji@redhat.com>
2546 * decl2.c (grokfield): when a typedef appears in a
2547 class, create the typedef variant type node for it.
2548 (save_template_attributes): Creating typedef variant type node
2549 here is now useless.
2550 * decl.c (grokdeclarator): If the typedef'ed struct/class was
2551 anonymous, set the proper type name to all its type variants.
2552 * name-lookup.c (pushdecl_maybe_friend): Reuse the
2553 set_underlying_type function to install typedef variant types.
2554 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
2556 (append_type_to_template_for_access_check): New entry points.
2557 * semantics.c (check_accessibility_of_qualified_id):
2558 When a typedef that is a member of a class appears in a template,
2559 add it to the template. It will be ...
2560 * pt.c (instantiate_class_template, instantiate_template ): ... access
2561 checked at template instantiation time.
2562 (tsubst): Handle the case of being called with NULL args.
2563 (resolve_type_name_type): The type name should be the name of the
2565 (append_type_to_template_for_access_check): New entry point.
2567 2009-01-19 Jason Merrill <jason@redhat.com>
2570 * parser.c (cp_parser_unqualified_id): In a template,
2572 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
2574 2009-01-16 Jason Merrill <jason@redhat.com>
2577 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
2578 * init.c (build_new): Don't call describable_type unless we
2582 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
2585 * search.c (protected_accessible_p): N doesn't vary.
2587 2009-01-15 Jason Merrill <jason@redhat.com>
2590 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
2591 accept hidden friends.
2593 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
2596 * decl.c (grokdeclarator): Check for a non namespace/class context.
2598 2009-01-15 Jason Merrill <jason@redhat.com>
2602 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
2603 a function isn't necessarily an lvalue. Take tree, not const_tree.
2604 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
2605 * typeck.c (lvalue_or_else): Likewise.
2606 * cp-tree.h: Adjust prototypes.
2608 2009-01-15 Steve Ellcey <sje@cup.hp.com>
2611 * pt.c (tsubst): Check for NULL args.
2613 2009-01-15 Dodji Seketeli <dodji@redhat.com>
2616 * name-lookup.c (pushtag): Don't create members to types that are not
2619 2009-01-14 Nick Clifton <nickc@redhat.com>
2622 * parser.c: Pass cp_id_kind computed in
2623 cp_parser_postfix_dot_deref_expression to
2624 cp_parser_primary_expression.
2626 2009-01-13 Jakub Jelinek <jakub@redhat.com>
2629 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
2630 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
2633 2009-01-12 Jason Merrill <jason@redhat.com>
2634 Steve Ellcey <sje@cup.hp.com>
2637 * name-lookup.c (lookup_name_real): Keep looking past a hidden
2640 2009-01-12 Dodji Seketeli <dodji@redhat.com>
2643 * pt.c (parameter_of_template_p): New function.
2644 * cp-tree.h: Declare it.
2645 * name-lookup.c (binding_to_template_parms_of_scope_p): New
2647 (outer_binding): Take template parameters in account when looking for
2650 2009-01-12 Jason Merrill <jason@redhat.com>
2653 * tree.c (pod_type_p): Return 1 for structs created by the back end.
2655 2009-01-12 Jakub Jelinek <jakub@redhat.com>
2658 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
2659 offsetof member-designator, handle it as `[0].'.
2662 * decl.c (start_function): If grokdeclarator hasn't returned
2663 FUNCTION_DECL nor error_mark_node, issue diagnostics.
2665 2009-01-11 Jakub Jelinek <jakub@redhat.com>
2668 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
2669 (gimplify_if_stmt): ... this.
2670 (cp_gimplify_expr): Don't handle IF_STMT here.
2671 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
2673 2009-01-10 Andrew Pinski <pinskia@gmail.com>
2676 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
2679 * typeck2.c (build_functional_cast): Check for reference type and NULL
2682 2009-01-09 Steve Ellcey <sje@cup.hp.com>
2684 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
2686 2009-01-09 Jakub Jelinek <jakub@redhat.com>
2689 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
2691 2009-01-09 John F. Carr <jfc@mit.edu>
2694 * parser.c (cp_parser_class_specifier): Clear
2695 parser->in_unbraced_linkage_specification_p while parsing class
2698 2009-01-07 Jakub Jelinek <jakub@redhat.com>
2701 * semantics.c (finish_goto_stmt): Convert destination to
2704 2009-01-06 Jason Merrill <jason@redhat.com>
2711 * pt.c (check_default_tmpl_args): Don't complain about
2712 out-of-order parameter packs in the enclosing class
2713 or parameter packs after default args.
2714 (coerce_template_parms): If we have more than one
2715 parameter pack, don't flatten argument packs.
2716 (template_args_equal): Handle argument packs.
2717 (comp_template_args): Don't flatten argument packs.
2718 (check_instantiated_arg): Split out from...
2719 (check_instantiated_args): Here. Handle arg packs.
2720 (convert_template_argument): Just check that nontype argument
2721 packs have the right type.
2723 2009-01-05 Dodji Seketeli <dodji@redhat.com>
2726 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
2728 2009-01-05 Jason Merrill <jason@redhat.com>
2731 * typeck2.c (process_init_constructor_union): Handle union with
2734 * mangle.c (write_expression): Remove mangling for zero-operand
2738 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
2742 * class.c (defaultable_fn_p): Only operator== can be a copy
2743 assignment operator.
2745 2009-01-02 Jason Merrill <jason@redhat.com>
2748 * typeck2.c (process_init_constructor_union): Handle excess
2750 (process_init_constructor_record): Likewise.
2753 * typeck2.c (digest_init_r): Don't use process_init_constructor
2754 for non-aggregate classes.
2757 Copyright (C) 2009 Free Software Foundation, Inc.
2759 Copying and distribution of this file, with or without modification,
2760 are permitted in any medium without royalty provided the copyright
2761 notice and this notice are preserved.