1 2009-03-23 Jason Merrill <jason@redhat.com>
4 * name-lookup.c (pushdecl_maybe_friend): Don't warn about shadowing
7 2009-03-20 Jason Merrill <jason@redhat.com>
10 * parser.c (cp_parser_direct_declarator): In a template, wrap
11 non-constant expression in NOP_EXPR with TREE_SIDE_EFFECTS set.
12 * pt.c (tsubst): Preserve it in a partial instantiation.
13 (dependent_type_p_r): Don't check value_dependent_expression_p.
14 * decl.c (compute_array_index_type): Don't check
15 value_dependent_expression_p if TREE_SIDE_EFFECTS.
18 * typeck2.c (check_narrowing): Don't complain about loss of
19 precision when converting a floating-point constant.
21 2009-03-19 Jakub Jelinek <jakub@redhat.com>
24 * parser.c (cp_parser_omp_for_cond): Don't check lhs if decl is NULL.
25 (cp_parser_omp_for_loop): Always use cp_parser_omp_for_cond.
27 2009-03-18 Jakub Jelinek <jakub@redhat.com>
29 * parser.c (struct cp_token): Reorder fields for 64-bit hosts.
32 2009-03-18 H.J. Lu <hongjiu.lu@intel.com>
35 * parser.c (cp_parser_explicit_specialization): Don't skip the
36 rest of the specialization when begin_specialization returns
39 2009-03-17 Jason Merrill <jason@redhat.com>
41 * decl.c (grokfndecl): Set DECL_CONTEXT on parms.
42 (duplicate_decls): Adjust DECL_CONTEXT of newdecl's parms.
43 * pt.c (check_explicit_specialization): Likewise.
44 (tsubst_copy) [PARM_DECL]: Return a dummy parm if we don't have a
46 * tree.c (cp_tree_equal) [PARM_DECL]: Check type and index, not name.
47 * decl2.c (parm_index): New fn.
48 * semantics.c (finish_decltype_type): Don't use describable_type.
49 * mangle.c (write_expression): Likewise. Mangle ALIGNOF_EXPR.
50 Give a sorry for unsupported codes rather than crash. Mangle
51 conversions with other than 1 operand. New mangling for PARM_DECL.
52 * operators.def (ALIGNOF_EXPR): Mangle as "az".
54 2009-03-17 Jing Yu <jingyu@google.com>
57 * method.c (use_thunk): Change is_thunk from crtl to cfun.
59 2009-03-17 Paolo Carlini <paolo.carlini@oracle.com>
62 * semantics.c (check_trait_type): New.
63 (finish_trait_expr): Use it.
65 2009-03-17 Jakub Jelinek <jakub@redhat.com>
67 * name-lookup.c (cp_emit_debug_info_for_using): Emit USING_STMTs
68 instead of calling imported_module_or_decl debug hook if
69 building_stmt_tree ().
70 * cp-gimplify.c (cp_gimplify_expr): Don't assert the first operand
74 * name-lookup.c (do_namespace_alias): Don't call global_decl debug
75 hook at function scope.
78 * cp-gimplify.c (cp_gimplify_expr): Don't set DECL_NAME
81 2009-03-09 Jakub Jelinek <jakub@redhat.com>
84 * semantics.c (finish_switch_cond): Don't call get_unwidened.
85 * decl.c (finish_case_label): Pass SWITCH_STMT_TYPE as 3rd argument
86 instead of TREE_TYPE (cond).
88 2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
91 * parser.c (cp_parser_late_parsing_default_args): Continue
92 the loop when cp_parser_assignment_expression returns
95 2009-03-07 Jason Merrill <jason@redhat.com>
98 * init.c (build_new_1): Don't use a VLA type.
99 (build_vec_init): Handle getting a pointer for BASE.
101 2009-03-06 H.J. Lu <hongjiu.lu@intel.com>
104 * cp-tree.h: Check NO_DOT_IN_LABEL before NO_DOLLAR_IN_LABEL
105 when mangling symbols.
107 2009-03-06 Paolo Carlini <paolo.carlini@oracle.com>
110 * error.c (dump_expr): Don't try to print THROW_EXPRs in full.
112 2009-03-06 Alexandre Oliva <aoliva@redhat.com>
114 * decl.c (record_builtin_java_type): Use canonicalized integer
117 2009-03-04 Jason Merrill <jason@redhat.com>
120 * class.c (is_really_empty_class): New fn.
121 * cp-tree.h: Declare it.
122 * cp-objcp-common.c (cp_expr_size): Use it.
125 * semantics.c (perform_koenig_lookup): Handle TEMPLATE_ID_EXPR.
126 * parser.c (cp_parser_postfix_expression): Call it for
128 * tree.c (is_overloaded_fn): Look through TEMPLATE_ID_EXPR.
129 (get_first_fn): Likewise.
135 * decl.c (make_typename_type): Do look inside currently open classes.
136 * parser.c (cp_parser_lookup_name): Likewise.
137 (cp_parser_template_name): Likewise.
138 * pt.c (dependent_scope_p): New function.
139 * cp-tree.h: Declare it.
140 * class.c (currently_open_class): Return fast if T isn't a class.
142 2009-02-26 H.J. Lu <hongjiu.lu@intel.com>
145 * parser.c (cp_parser_mem_initializer): Return error_mark_node
146 if cp_parser_mem_initializer_id returns error_mark_node.
148 2009-02-24 Richard Guenther <rguenther@suse.de>
151 * pt.c (instantiate_decl): Do not instantiate extern, non-inline
154 2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
157 * pt.c (coerce_template_template_parms): Return 0 if parameter
160 2009-02-23 Jason Merrill <jason@redhat.com>
162 * pt.c (unify): Call maybe_adjust_types_for_deduction when
163 deducing from an initializer list.
165 2009-02-20 Jason Merrill <jason@redhat.com>
168 * decl.c (grokdeclarator): Handle ~identifier.
170 2009-02-19 Jakub Jelinek <jakub@redhat.com>
173 * decl2.c (determine_visibility): If visibility changed and
174 DECL_RTL has been already set, call make_decl_rtl to update symbol
177 2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
180 * cp-tree.h (maybe_commonize_var): New.
182 * decl.c (maybe_commonize_var): Make it extern.
184 * decl2.c (finish_anon_union): Call maybe_commonize_var.
186 2009-02-18 H.J. Lu <hongjiu.lu@intel.com>
189 * parser.c (cp_parser_enum_specifier): Apply all attributes.
191 2009-02-18 Jason Merrill <jason@redhat.com>
193 * cfns.h: Tweak pathname for cfns.gperf.
195 2009-02-13 Jason Merrill <jason@redhat.com>
198 * semantics.c (finish_call_expr): Change koenig_p parm to int.
199 If -1, don't set KOENIG_LOOKUP_P but do keep hidden candidates.
200 * cp-tree.h: Adjust prototype.
201 * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Pass -1.
203 2009-02-12 Jason Merrill <jason@redhat.com>
206 * pt.c (unify)[TEMPLATE_PARM_INDEX]: Convert to the tsubsted type.
208 2009-02-11 Jason Merrill <jason@redhat.com>
211 * decl2.c (cp_write_global_declarations):
212 Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
215 * init.c (build_value_init_noctor): Split out from...
216 (build_value_init): ...here.
217 (expand_aggr_init_1): Handle value-initialization.
218 * cp-tree.h: Add declaration.
219 * class.c (type_has_user_provided_constructor):
220 Handle non-class arguments.
222 2009-02-10 Jason Merrill <jason@redhat.com>
225 * class.c (defaultable_fn_p): Handle ... properly.
228 * tree.c (lvalue_p_1): Condition rvalue ref handling on
229 treat_class_rvalues_as_lvalues, too.
231 2009-02-10 Paolo Carlini <paolo.carlini@oracle.com>
234 * typeck.c (build_x_array_ref): New.
235 * cp-tree.h: Declare it.
236 * pt.c (tsubst_copy_and_build): Use it for case ARRAY_REF.
238 2009-02-09 Jason Merrill <jason@redhat.com>
241 * semantics.c (simplify_aggr_init_expr): Do zero-initialization here.
242 * init.c (build_value_init): Not here. Don't build a TARGET_EXPR.
243 * tree.c (get_target_expr): Handle AGGR_INIT_EXPR.
244 * cp-gimplify.c (cp_gimplify_init_expr): Remove special handling
245 for build_value_init TARGET_EXPR.
246 * cp-tree.h (AGGR_INIT_ZERO_FIRST): New macro.
248 2009-02-06 Paolo Carlini <paolo.carlini@oracle.com>
252 * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Check TREE_VEC_LENGTH.
254 2009-02-04 Jakub Jelinek <jakub@redhat.com>
257 * operators.def: Use COMPONENT_REF code for ->/pt operator again,
258 remove ./dt operator.
259 * mangle.c (write_expression): Handle COMPONENT_REF after handling
260 ADDR_EXPR, for COMPONENT_REF without ARROW_EXPR inside of it
261 write_string ("dt") instead of using operators.def.
263 2009-02-03 Jason Merrill <jason@redhat.com>
265 * typeck.c (cp_build_unary_op): Only complain about taking address
268 2009-02-03 Jakub Jelinek <jakub@redhat.com>
271 * parser.c (cp_parser_primary_expression): Reject FIXED_CSTs.
274 * typeck2.c (digest_init_r): Don't call process_init_constructor
277 2009-02-03 Paolo Bonzini <bonzini@gnu.org>
280 * pt.c (convert_nontype_argument_function): Expect expr to be an
284 * typeck.c (merge_types): Call resolve_typename_type if only
285 one type is a typename.
287 2009-02-02 Jason Merrill <jason@redhat.com>
290 * parser.c (cp_parser_unqualified_id): Don't wrap error_mark_node
293 2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
296 * parser.c (cp_parser_pure_specifier): If there are no tokens left
297 do not call cp_lexer_consume_token.
299 2009-01-30 Jakub Jelinek <jakub@redhat.com>
302 * parser.c (cp_parser_already_scoped_statement): Handle __label__
305 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
308 * error.c (dump_expr): Handle FIX_TRUNC_EXPR and FLOAT_EXPR.
310 2009-01-30 Paolo Carlini <paolo.carlini@oracle.com>
313 * error.c (dump_type_prefix, dump_type_suffix): Handle FIXED_POINT_TYPE.
315 2009-01-29 Paolo Carlini <paolo.carlini@oracle.com>
317 * typeck.c (invalid_nonstatic_memfn_p): Use
318 DECL_NONSTATIC_MEMBER_FUNCTION_P.
320 2009-01-27 Paolo Carlini <paolo.carlini@oracle.com>
323 * call.c (build_over_call): If convert_for_arg_passing returns
324 error_mark_node unconditionally return it.
326 2009-01-22 Adam Nemet <anemet@caviumnetworks.com>
328 * class.c (check_field_decls): Also inherit packed for bitfields
329 regardless of their type.
331 2009-01-22 Dodji Seketeli <dodji@redhat.com>
334 * decl2.c (grokfield): Reverting changes of PR c++/26693
335 (save_template_attributes): Likewise.
336 * decl.c (grokdeclarator): Likewise.
337 * name-lookup.c (pushdecl_maybe_friend): Likewise.
338 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): Likewise.
339 (append_type_to_template_for_access_check): Likewise.
340 * semantics.c (check_accessibility_of_qualified_id): Likewise.
341 * pt.c (instantiate_class_template, instantiate_template ): Likewise.
343 (resolve_type_name_type): Likewise.
344 (append_type_to_template_for_access_check): Likewise.
346 2009-01-21 Dodji Seketeli <dodji@redhat.com>
349 * decl2.c (grokfield): when a typedef appears in a
350 class, create the typedef variant type node for it.
351 (save_template_attributes): Creating typedef variant type node
353 * decl.c (grokdeclarator): If the typedef'ed struct/class was
354 anonymous, set the proper type name to all its type variants.
355 * name-lookup.c (pushdecl_maybe_friend): Reuse the
356 set_underlying_type function to install typedef variant types.
357 * cp-tree.h (MEMBER_TYPES_NEEDING_ACCESS_CHECK): New template accessor
359 (append_type_to_template_for_access_check): New entry points.
360 * semantics.c (check_accessibility_of_qualified_id):
361 When a typedef that is a member of a class appears in a template,
362 add it to the template. It will be ...
363 * pt.c (instantiate_class_template, instantiate_template ): ... access
364 checked at template instantiation time.
365 (tsubst): Handle the case of being called with NULL args.
366 (resolve_type_name_type): The type name should be the name of the
368 (append_type_to_template_for_access_check): New entry point.
370 2009-01-19 Jason Merrill <jason@redhat.com>
373 * parser.c (cp_parser_unqualified_id): In a template,
375 * typeck.c (lookup_destructor): Handle IDENTIFIER_NODE.
377 2009-01-16 Jason Merrill <jason@redhat.com>
380 * tree.c (lvalue_p_1): Allow non-fields in COMPONENT_REF.
381 * init.c (build_new): Don't call describable_type unless we
385 * pt.c (tsubst_decl) [USING_DECL]: Propagate access flags.
388 * search.c (protected_accessible_p): N doesn't vary.
390 2009-01-15 Jason Merrill <jason@redhat.com>
393 * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
394 accept hidden friends.
396 2009-01-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
399 * decl.c (grokdeclarator): Check for a non namespace/class context.
401 2009-01-15 Jason Merrill <jason@redhat.com>
405 * tree.c (lvalue_p_1): Handle BASELINK. A COMPONENT_REF to
406 a function isn't necessarily an lvalue. Take tree, not const_tree.
407 (lvalue_p, real_lvalue_p): Take tree, not const_tree.
408 * typeck.c (lvalue_or_else): Likewise.
409 * cp-tree.h: Adjust prototypes.
411 2009-01-15 Steve Ellcey <sje@cup.hp.com>
414 * pt.c (tsubst): Check for NULL args.
416 2009-01-15 Dodji Seketeli <dodji@redhat.com>
419 * name-lookup.c (pushtag): Don't create members to types that are not
422 2009-01-14 Nick Clifton <nickc@redhat.com>
425 * parser.c: Pass cp_id_kind computed in
426 cp_parser_postfix_dot_deref_expression to
427 cp_parser_primary_expression.
429 2009-01-13 Jakub Jelinek <jakub@redhat.com>
432 * tree.c (cp_walk_subtrees): Handle REINTERPRET_CAST_EXPR,
433 STATIC_CAST_EXPR, CONST_CAST_EXPR and DYNAMIC_CAST_EXPR the same
436 2009-01-12 Jason Merrill <jason@redhat.com>
437 Steve Ellcey <sje@cup.hp.com>
440 * name-lookup.c (lookup_name_real): Keep looking past a hidden
443 2009-01-12 Dodji Seketeli <dodji@redhat.com>
446 * pt.c (parameter_of_template_p): New function.
447 * cp-tree.h: Declare it.
448 * name-lookup.c (binding_to_template_parms_of_scope_p): New
450 (outer_binding): Take template parameters in account when looking for
453 2009-01-12 Jason Merrill <jason@redhat.com>
456 * tree.c (pod_type_p): Return 1 for structs created by the back end.
458 2009-01-12 Jakub Jelinek <jakub@redhat.com>
461 * parser.c (cp_parser_builtin_offsetof): Allow `->' in
462 offsetof member-designator, handle it as `[0].'.
465 * decl.c (start_function): If grokdeclarator hasn't returned
466 FUNCTION_DECL nor error_mark_node, issue diagnostics.
468 2009-01-11 Jakub Jelinek <jakub@redhat.com>
471 * cp-gimplify.c (genericize_if_stmt): Renamed from ...
472 (gimplify_if_stmt): ... this.
473 (cp_gimplify_expr): Don't handle IF_STMT here.
474 (cp_genericize_r): Call genericize_if_stmt for IF_STMT.
476 2009-01-10 Andrew Pinski <pinskia@gmail.com>
479 * typeck.c (cp_build_modify_expr): Check for NULL current_function_decl.
482 * typeck2.c (build_functional_cast): Check for reference type and NULL
485 2009-01-09 Steve Ellcey <sje@cup.hp.com>
487 * typeck.c (cp_build_unary_op): Check for ERROR_MARK.
489 2009-01-09 Jakub Jelinek <jakub@redhat.com>
492 * error.c (dump_expr): Handle EXPR_STMT like BIND_EXPR.
494 2009-01-09 John F. Carr <jfc@mit.edu>
497 * parser.c (cp_parser_class_specifier): Clear
498 parser->in_unbraced_linkage_specification_p while parsing class
501 2009-01-07 Jakub Jelinek <jakub@redhat.com>
504 * semantics.c (finish_goto_stmt): Convert destination to
507 2009-01-06 Jason Merrill <jason@redhat.com>
514 * pt.c (check_default_tmpl_args): Don't complain about
515 out-of-order parameter packs in the enclosing class
516 or parameter packs after default args.
517 (coerce_template_parms): If we have more than one
518 parameter pack, don't flatten argument packs.
519 (template_args_equal): Handle argument packs.
520 (comp_template_args): Don't flatten argument packs.
521 (check_instantiated_arg): Split out from...
522 (check_instantiated_args): Here. Handle arg packs.
523 (convert_template_argument): Just check that nontype argument
524 packs have the right type.
526 2009-01-05 Dodji Seketeli <dodji@redhat.com>
529 * typeck.c (type_after_usual_arithmetic_conversions): Fix a typo.
531 2009-01-05 Jason Merrill <jason@redhat.com>
534 * typeck2.c (process_init_constructor_union): Handle union with
537 * mangle.c (write_expression): Remove mangling for zero-operand
541 * decl.c (cp_finish_decl): Clear DECL_INITIAL for invalid
545 * class.c (defaultable_fn_p): Only operator== can be a copy
548 2009-01-02 Jason Merrill <jason@redhat.com>
551 * typeck2.c (process_init_constructor_union): Handle excess
553 (process_init_constructor_record): Likewise.
556 * typeck2.c (digest_init_r): Don't use process_init_constructor
557 for non-aggregate classes.