1 2009-03-17 Jason Merrill <jason@redhat.com>
3 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
4 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
5 * pt.c (check_explicit_specialization): Likewise.
6 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
8 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
9 * decl2.c (parm_index): New fn.
10 * semantics.c (finish_decltype_type): Don't use describable_type.
11 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
12 Give a sorry for unsupported codes rather than crash. Mangle
13 conversions with other than 1 operand. New mangling for PARM_DECL.
14 * operators.def (ALIGNOF_EXPR): Mangle as "az".
16 2009-03-17 Jing Yu <jingyu@google.com>
19 * method.c (use_thunk): Change is_thunk from crtl to cfun.
21 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
24 * semantics.c (check_trait_type): New.
25 (finish_trait_expr): Use it.
27 2009-03-17 Jakub Jelinek <jakub@redhat.com>
29 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
30 instead of calling imported_module_or_decl debug hook if
31 building_stmt_tree ().
32 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
36 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
37 hook at function scope.
40 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
43 2009-03-09 Jakub Jelinek <jakub@redhat.com>
46 * semantics.c (finish_switch_cond): Don't call get_unwidened.
47 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
48 instead of TREE_TYPE (cond).
50 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
53 * parser.c (cp_parser_late_parsing_default_args): Continue
54 the loop when cp_parser_assignment_expression returns
57 2009-03-07 Jason Merrill <jason@redhat.com>
60 * init.c (build_new_1): Don't use a VLA type.
61 (build_vec_init): Handle getting a pointer for BASE.
63 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
66 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
67 when mangling symbols.
69 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
72 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
74 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
76 * decl.c (record_builtin_java_type): Use canonicalized integer
79 2009-03-04 Jason Merrill <jason@redhat.com>
82 * class.c (is_really_empty_class): New fn.
83 * cp-tree.h: Declare it.
84 * cp-objcp-common.c (cp_expr_size): Use it.
87 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
88 * parser.c (cp_parser_postfix_expression): Call it for
90 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
91 (get_first_fn): Likewise.
97 * decl.c (make_typename_type): Do look inside currently open classes.
98 * parser.c (cp_parser_lookup_name): Likewise.
99 (cp_parser_template_name): Likewise.
100 * pt.c (dependent_scope_p): New function.
101 * cp-tree.h: Declare it.
102 * class.c (currently_open_class): Return fast if T isn't a class.
104 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
107 * parser.c (cp_parser_mem_initializer): Return error_mark_node
108 if cp_parser_mem_initializer_id returns error_mark_node.
110 2009-02-24 Richard Guenther <rguenther@suse.de>
113 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
116 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
119 * pt.c (coerce_template_template_parms): Return 0 if parameter
122 2009-02-23 Jason Merrill <jason@redhat.com>
124 * pt.c (unify): Call maybe_adjust_types_for_deduction when
125 deducing from an initializer list.
127 2009-02-20 Jason Merrill <jason@redhat.com>
130 * decl.c (grokdeclarator): Handle ~identifier.
132 2009-02-19 Jakub Jelinek <jakub@redhat.com>
135 * decl2.c (determine_visibility): If visibility changed and
136 DECL_RTL has been already set, call make_decl_rtl to update symbol
139 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
142 * cp-tree.h (maybe_commonize_var): New.
144 * decl.c (maybe_commonize_var): Make it extern.
146 * decl2.c (finish_anon_union): Call maybe_commonize_var.
148 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
151 * parser.c (cp_parser_enum_specifier): Apply all attributes.
153 2009-02-18 Jason Merrill <jason@redhat.com>
155 * cfns.h: Tweak pathname for cfns.gperf.
157 2009-02-13 Jason Merrill <jason@redhat.com>
160 * semantics.c (finish_call_expr): Change koenig_p parm to int.
161 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
162 * cp-tree.h: Adjust prototype.
163 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
165 2009-02-12 Jason Merrill <jason@redhat.com>
168 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
170 2009-02-11 Jason Merrill <jason@redhat.com>
173 * decl2.c (cp_write_global_declarations):
174 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
177 * init.c (build_value_init_noctor): Split out from...
178 (build_value_init): ...here.
179 (expand_aggr_init_1): Handle value-initialization.
180 * cp-tree.h: Add declaration.
181 * class.c (type_has_user_provided_constructor):
182 Handle non-class arguments.
184 2009-02-10 Jason Merrill <jason@redhat.com>
187 * class.c (defaultable_fn_p): Handle ... properly.
190 * tree.c (lvalue_p_1): Condition rvalue ref handling on
191 treat_class_rvalues_as_lvalues, too.
193 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
196 * typeck.c (build_x_array_ref): New.
197 * cp-tree.h: Declare it.
198 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
200 2009-02-09 Jason Merrill <jason@redhat.com>
203 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
204 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
205 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
206 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
207 for build_value_init TARGET_EXPR.
208 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
210 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
214 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
216 2009-02-04 Jakub Jelinek <jakub@redhat.com>
219 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
220 remove ./dt operator.
221 * mangle.c (write_expression): Handle COMPONENT_REF after handling
222 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
223 write_string ("dt") instead of using operators.def.
225 2009-02-03 Jason Merrill <jason@redhat.com>
227 * typeck.c (cp_build_unary_op): Only complain about taking address
230 2009-02-03 Jakub Jelinek <jakub@redhat.com>
233 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
236 * typeck2.c (digest_init_r): Don't call process_init_constructor
239 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
242 * pt.c (convert_nontype_argument_function): Expect expr to be an
246 * typeck.c (merge_types): Call resolve_typename_type if only
247 one type is a typename.
249 2009-02-02 Jason Merrill <jason@redhat.com>
252 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
255 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
258 * parser.c (cp_parser_pure_specifier): If there are no tokens left
259 do not call cp_lexer_consume_token.
261 2009-01-30 Jakub Jelinek <jakub@redhat.com>
264 * parser.c (cp_parser_already_scoped_statement): Handle __label__
267 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
270 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
272 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
275 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
277 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
279 * typeck.c (invalid_nonstatic_memfn_p): Use
280 DECL_NONSTATIC_MEMBER_FUNCTION_P.
282 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
285 * call.c (build_over_call): If convert_for_arg_passing returns
286 error_mark_node unconditionally return it.
288 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
290 * class.c (check_field_decls): Also inherit packed for bitfields
291 regardless of their type.
293 2009-01-22 Dodji Seketeli <dodji@redhat.com>
296 * decl2.c (grokfield): Reverting changes of PR c++/26693
297 (save_template_attributes): Likewise.
298 * decl.c (grokdeclarator): Likewise.
299 * name-lookup.c (pushdecl_maybe_friend): Likewise.
300 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
301 (append_type_to_template_for_access_check): Likewise.
302 * semantics.c (check_accessibility_of_qualified_id): Likewise.
303 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
305 (resolve_type_name_type): Likewise.
306 (append_type_to_template_for_access_check): Likewise.
308 2009-01-21 Dodji Seketeli <dodji@redhat.com>
311 * decl2.c (grokfield): when a typedef appears in a
312 class, create the typedef variant type node for it.
313 (save_template_attributes): Creating typedef variant type node
315 * decl.c (grokdeclarator): If the typedef'ed struct/class was
316 anonymous, set the proper type name to all its type variants.
317 * name-lookup.c (pushdecl_maybe_friend): Reuse the
318 set_underlying_type function to install typedef variant types.
319 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
321 (append_type_to_template_for_access_check): New entry points.
322 * semantics.c (check_accessibility_of_qualified_id):
323 When a typedef that is a member of a class appears in a template,
324 add it to the template. It will be ...
325 * pt.c (instantiate_class_template, instantiate_template ): ... access
326 checked at template instantiation time.
327 (tsubst): Handle the case of being called with NULL args.
328 (resolve_type_name_type): The type name should be the name of the
330 (append_type_to_template_for_access_check): New entry point.
332 2009-01-19 Jason Merrill <jason@redhat.com>
335 * parser.c (cp_parser_unqualified_id): In a template,
337 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
339 2009-01-16 Jason Merrill <jason@redhat.com>
342 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
343 * init.c (build_new): Don't call describable_type unless we
347 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
350 * search.c (protected_accessible_p): N doesn't vary.
352 2009-01-15 Jason Merrill <jason@redhat.com>
355 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
356 accept hidden friends.
358 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
361 * decl.c (grokdeclarator): Check for a non namespace/class context.
363 2009-01-15 Jason Merrill <jason@redhat.com>
367 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
368 a function isn't necessarily an lvalue. Take tree, not const_tree.
369 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
370 * typeck.c (lvalue_or_else): Likewise.
371 * cp-tree.h: Adjust prototypes.
373 2009-01-15 Steve Ellcey <sje@cup.hp.com>
376 * pt.c (tsubst): Check for NULL args.
378 2009-01-15 Dodji Seketeli <dodji@redhat.com>
381 * name-lookup.c (pushtag): Don't create members to types that are not
384 2009-01-14 Nick Clifton <nickc@redhat.com>
387 * parser.c: Pass cp_id_kind computed in
388 cp_parser_postfix_dot_deref_expression to
389 cp_parser_primary_expression.
391 2009-01-13 Jakub Jelinek <jakub@redhat.com>
394 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
395 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
398 2009-01-12 Jason Merrill <jason@redhat.com>
399 Steve Ellcey <sje@cup.hp.com>
402 * name-lookup.c (lookup_name_real): Keep looking past a hidden
405 2009-01-12 Dodji Seketeli <dodji@redhat.com>
408 * pt.c (parameter_of_template_p): New function.
409 * cp-tree.h: Declare it.
410 * name-lookup.c (binding_to_template_parms_of_scope_p): New
412 (outer_binding): Take template parameters in account when looking for
415 2009-01-12 Jason Merrill <jason@redhat.com>
418 * tree.c (pod_type_p): Return 1 for structs created by the back end.
420 2009-01-12 Jakub Jelinek <jakub@redhat.com>
423 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
424 offsetof member-designator, handle it as `[0].'.
427 * decl.c (start_function): If grokdeclarator hasn't returned
428 FUNCTION_DECL nor error_mark_node, issue diagnostics.
430 2009-01-11 Jakub Jelinek <jakub@redhat.com>
433 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
434 (gimplify_if_stmt): ... this.
435 (cp_gimplify_expr): Don't handle IF_STMT here.
436 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
438 2009-01-10 Andrew Pinski <pinskia@gmail.com>
441 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
444 * typeck2.c (build_functional_cast): Check for reference type and NULL
447 2009-01-09 Steve Ellcey <sje@cup.hp.com>
449 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
451 2009-01-09 Jakub Jelinek <jakub@redhat.com>
454 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
456 2009-01-09 John F. Carr <jfc@mit.edu>
459 * parser.c (cp_parser_class_specifier): Clear
460 parser->in_unbraced_linkage_specification_p while parsing class
463 2009-01-07 Jakub Jelinek <jakub@redhat.com>
466 * semantics.c (finish_goto_stmt): Convert destination to
469 2009-01-06 Jason Merrill <jason@redhat.com>
476 * pt.c (check_default_tmpl_args): Don't complain about
477 out-of-order parameter packs in the enclosing class
478 or parameter packs after default args.
479 (coerce_template_parms): If we have more than one
480 parameter pack, don't flatten argument packs.
481 (template_args_equal): Handle argument packs.
482 (comp_template_args): Don't flatten argument packs.
483 (check_instantiated_arg): Split out from...
484 (check_instantiated_args): Here. Handle arg packs.
485 (convert_template_argument): Just check that nontype argument
486 packs have the right type.
488 2009-01-05 Dodji Seketeli <dodji@redhat.com>
491 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
493 2009-01-05 Jason Merrill <jason@redhat.com>
496 * typeck2.c (process_init_constructor_union): Handle union with
499 * mangle.c (write_expression): Remove mangling for zero-operand
503 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
507 * class.c (defaultable_fn_p): Only operator== can be a copy
510 2009-01-02 Jason Merrill <jason@redhat.com>
513 * typeck2.c (process_init_constructor_union): Handle excess
515 (process_init_constructor_record): Likewise.
518 * typeck2.c (digest_init_r): Don't use process_init_constructor
519 for non-aggregate classes.