1 2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4 * class.c (check_bases_and_members): Warn with -Wuninitialized
7 2008-08-08 Volker Reichelt <v.reichelt@netcologne.de>
10 * decl.c (xref_basetypes): Check base for MAYBE_CLASS_TYPE_P,
11 and make sure it is not a union.
13 2008-08-07 H.J. Lu <hongjiu.lu@intel.com>
15 * semantics.c (finish_decltype_type): Initialize type.
17 2008-08-07 Douglas Gregor <doug.gregor@gmail.com>
19 * semantics.c (finish_decltype_type): Handle calls to function
20 pointers and references to functions properly.
22 2008-08-06 Douglas Gregor <doug.gregor@gmail.com>
25 * parser.c (cp_parser_template_argument): Don't assume that '>>'
26 following a type-id is an error when in C++0x mode.
28 2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
31 * decl.c (grokdeclarator): Use explicit location with permerror_at.
33 2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
36 * typeck.c (cp_build_binary_op): Move code to c-common.c.
38 2008-08-05 Jason Merrill <jason@redhat.com>
41 * decl.c (build_ptrmemfunc_type): Don't require structural
42 comparison of PMF types.
43 * tree.c (cp_build_qualified_type_real): Don't clear
44 a valid TYPE_PTRMEMFUNC_TYPE.
45 * typeck.c (cp_build_unary_op): Still do build_ptrmemfunc in
48 2008-08-04 Jason Merrill <jason@redhat.com>
51 * typeck2.c (check_narrowing): Allow narrowing conversion
52 from an explicit floating-point constant.
55 * pt.c (tsubst_decl): Leave DECL_INITIAL set on deleted
58 2008-08-04 Simon Baldwin <simonb@google.com>
61 * parser.c (cp_parser_elaborated_type_specifier): Warn only when
62 the declaration's id is followed by a semicolon.
64 2008-07-31 Jakub Jelinek <jakub@redhat.com>
67 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Call
68 complete_type_or_else even for UNKNOWN_TYPE to get diagnostics.
70 2008-07-31 Jason Merrill <jason@redhat.com>
73 * init.c (build_new_1): Don't convert pointer to the data type
74 until we're actually going to treat it as that type.
77 * tree.c (build_aggr_init_expr): Split out...
78 (build_cplus_new): ...from here.
79 (stabilize_init): Don't mess with AGGR_INIT_EXPR either.
80 * init.c (build_new_1): new T() means value-initialization,
81 not default-initialization.
82 (build_vec_init): Likewise.
83 (build_value_init_1): Use build_aggr_init_expr.
85 2008-07-30 Dodji Seketeli <dseketel@redhat.com>
88 * decl2.c (fix_temporary_vars_context_r): New function.
89 (one_static_initialization_or_destruction): Make sure temporary
90 variables part of the initialiser have their DECL_CONTEXT()
93 2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
96 * typeck.c (build_binary_op): Encapsulate code into
99 2008-07-29 Jakub Jelinek <jakub@redhat.com>
102 * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
103 TYPE_UID instead of pointers.
105 2008-07-29 Jan Hubicka <jh@suse.cz>
107 * optimize.c (maybe_clone_body): Remove DECL_INLINE.
108 * decl.c (duplicate_decls): Likewise.
109 (grokfndecl): Likewise.
110 (start_method): Likewise.
111 * method.c (make_thunk, make_alias_for, implicitly_declare_fn):
113 * pt.c (register_specialization, regenerate_decl_from_template):
115 * decl2.c (grokfield): Likewise.
117 2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
120 * decl.c (duplicate_decls): Merge USED flags.
122 2008-07-27 Jason Merrill <jason@redhat.com>
125 * decl.c (reshape_init_r): Allow C++0x initializer lists.
127 2008-07-28 Richard Guenther <rguenther@suse.de>
129 Merge from gimple-tuples-branch.
131 2008-07-22 Aldy Hernandez <aldyh@redhat.com>
133 * cp-gimplify.c (gimplify_if_stmt): Set location on newly created
136 2008-07-18 Jakub Jelinek <jakub@redhat.com>
138 * decl.c (finish_function): Call gimple_body after cp_genericize.
140 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
142 * optimize.c: Include gimple.h instead of tree-gimple.h.
143 * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h.
144 * cp-gimplify.c: Rename tree-gimple.h to gimple.h. Include
147 2008-07-16 Jakub Jelinek <jakub@redhat.com>
149 * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone.
151 2008-07-14 Jakub Jelinek <jakub@redhat.com>
153 * cp-gimplify.c (cp_gimplify_expr): Update comment.
155 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
157 * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to
159 * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename
160 GIMPLE_MODIFY_STMT to MODIFY_EXPR.
161 (cxx_omp_clause_copy_ctor): Same.
162 (cxx_omp_clause_assign_op): Same.
164 2008-05-28 Jakub Jelinek <jakub@redhat.com>
166 * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument. Tuplify.
167 (cp_gimplify_expr): Adjust caller.
169 2008-05-11 Doug Kwan <dougkwan@google.com>
171 * init.c (build_vec_delete): Add type conversion for argument
172 0 of POINTER_PLUS_EXPR.
174 2008-04-29 Doug Kwan <dougkwan@google.com>
176 * decl2 (File): Include "gimple.h"
177 (cp_write_global_declarations): Use gimple_body instead of
179 * Make-lang.in (cp/decl2.o): Add $(GIMPLE_H)
181 2008-04-10 Diego Novillo <dnovillo@google.com>
183 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html
185 * optimize.c (maybe_clone_body): Re-enable call to
187 * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled
188 code with call to gimple_unreachable.
189 (cp_genericize): Fix handling of clone bodies.
191 2008-04-04 Diego Novillo <dnovillo@google.com>
193 http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html
195 * optimize.c (maybe_clone_body): Re-enable.
197 2008-02-19 Diego Novillo <dnovillo@google.com>
198 Oleg Ryjkov <olegr@google.com>
200 http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
202 * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq
203 argument to gimple_seq *. Update all users.
204 (gimplify_must_not_throw_expr): Likewise.
206 2008-02-04 Oleg Ryjkov <olegr@google.com>
208 * except.c: Include gimple.h
209 (cp_protect_cleanup_actions): Convert to tuples.
210 * Make-lang.in (cp/except.o): Add dependency on gimple.h
212 2007-11-10 Aldy Hernandez <aldyh@redhat.com>
214 * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus
215 instead of annotating each block manually.
217 2007-10-30 Aldy Hernandez <aldyh@redhat.com>
219 * cp-gimplify.c (gimplify_cp_loop): Tuplify.
220 (gimplify_for_stmt): Same.
221 (gimplify_switch_stmt): Same.
222 (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt. Return
224 [WHILE_STMT]: Return GS_OK.
226 [CONTINUE_STMT]: Same.
228 (cp_genericize): Set gimple_body() of cloned functions when needed.
230 2007-10-29 Aldy Hernandez <aldy@quesejoda.com>
232 * cp-gimplify.c: Move build_gimple_eh_filter_tree here.
233 (cp_gimplify_init_expr): Convert to tuples.
234 (gimplify_must_not_throw_expr): Make function return a
235 gimplify_status and convert to tuples.
237 2007-10-18 Aldy Hernandez <aldy@quesejoda.com>
239 * cp-gimplify.c (genericize_try_block): Enable and do not call
241 (genericize_catch_block): Same.
242 (genericize_eh_spec_block): Same.
243 Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
244 (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK.
246 2007-10-16 Aldy Hernandez <aldy@quesejoda.com>
248 * optimize.c (maybe_clone_body): Comment out call to clone_body.
249 * decl.c (finish_function): Use gimple_body instead of
251 * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences.
252 * cp-gimplify.c (genericize_try_block): Comment out.
253 (genericize_catch_block): Same.
254 (genericize_eh_spec_block): Same.
255 (gimplify_cp_loop): Comment out calls to gimplify_stmt.
256 (gimplify_for_stmt): Comment out.
257 (gimplify_switch_stmt): Comment out call to gimplify_stmt.
258 (cp_gimplify_omp_for): Same.
259 (gimplify_must_not_throw_expr): Argument pre_p is a sequence.
260 Comment out call to gimplify_stmt and append_to_statement_list.
261 Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
262 (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences.
263 (cp_gimplify_expr): Same.
264 Comment out calls to genericize_*_block. Comment out call to
267 2008-07-27 H.J. Lu <hongjiu.lu@intel.com>
270 * class.c (type_has_user_provided_default_constructor): Handle
273 2008-07-27 Paolo Carlini <paolo.carlini@oracle.com>
275 * decl.c (push_library_fn): Add a parameter for the exceptions that
276 the function may throw.
277 (push_void_library_fn, push_throw_library_fn, expand_static_init):
279 (build_library_fn): Change to static.
280 * cp-tree.h: Adjust declarations.
281 * except.c (declare_nothrow_library_fn): New.
282 (do_get_exception_ptr, do_begin_catch, do_free_exception,
283 do_allocate_exception): Use the latter, adjust the declarations
284 (ie, add empty exception-specification), consistently with the
285 actual implementation in libsupc++.
287 2008-07-25 Jan Hubicka <jh@suse.cz>
289 * typeck.c (inline_conversion): Remove.
290 (cp_build_function_call): Do not use inline_conversion.
291 * decl.c (duplicate_decls): Do not insist on inline being declared
293 (start_cleanup_fn): Do not assume that INLINE flags prevent function
294 from being output. We now remove static functions always.
295 (finish_function): Do return warning on all static functions.
296 * call.c (build_over_call): Do not use inline_conversion.
297 * cp-tree.h (possibly_inlined_p): Declare.
298 (inline_conversion): Remove.
299 * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
300 * decl2.c (cp_write_global_declarations): Likewise.
301 (mark_used): Likewise.
302 (possibly_inlined_p): New functions.
304 2008-07-25 Jason Merrill <jason@redhat.com>
306 * class.c (type_has_user_provided_default_constructor): Handle
309 2008-07-23 Jan Hubicka <jh@suse.cz>
311 * decl.c (duplicate_decls): Update comment and unit-at-a-time.
312 (grogfndecl): Drop flag_inline_trees code.
313 * pt.c (instantiate_decl): Drop flag_iline_trees code.
314 * lex.c (cxx_init): Do not set unit-at-a-time.
316 2008-07-23 Jason Merrill <jason@redhat.com>
318 * mangle.c (write_unqualified_name): Avoid infinite recursion when
319 trying to mangle a decl with no name.
321 Implement defaulted/deleted functions as per N2346
322 * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
323 (DECL_DELETED_FN): New macro.
324 (DECL_DEFAULTED_FN): New macro.
325 * class.c (user_provided_p): New fn.
326 (defaultable_fn_p): New fn.
327 (type_has_user_provided_constructor): New fn.
328 (type_has_user_provided_default_constructor): New fn.
329 (check_methods): A defaulted fn is still trivial.
330 (check_bases_and_members): Likewise.
331 * decl.c (grok_special_member_properties): Likewise.
332 (duplicate_decls): Complain about redeclaring a function as deleted.
333 (start_decl): initialized==2 means deleted.
334 (cp_finish_decl): Handle deleted/defaulted semantics.
335 * decl2.c (grokfield): Likewise.
336 (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
337 Complain about using a deleted fn.
338 * init.c (build_value_init_1): Use type_has_user_provided_constructor.
339 (perform_member_init): Check for a user-provided default constructor
340 even if TYPE_NEEDS_CONSTRUCTING.
341 (build_new_1): Likewise.
342 * call.c (build_over_call): Don't call mark_used twice.
343 * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
344 * search.c (check_final_overrider): Check for deleted mismatch.
345 * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
346 (cp_parser_pure_specifier): Handle =default and =delete.
348 * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
350 2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
353 * typeck.c: All calls to pedwarn changed.
354 * decl.c: All calls to pedwarn changed.
355 * call.c: All calls to pedwarn changed.
356 * error.c: All calls to pedwarn changed.
357 * typeck2.c: All calls to pedwarn changed.
358 * pt.c: All calls to pedwarn changed.
359 * name-lookup.c: All calls to pedwarn changed.
360 * parser.c: All calls to pedwarn changed.
362 2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
364 * call.c: Fix comment typos.
366 * cp-tree.h: Likewise.
367 * cxx-pretty-print.c: Likewise.
370 * name-lookup.c: Likewise.
371 * operators.def: Likewise.
372 * parser.c: Likewise.
375 * typeck.c: Likewise.
377 2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
381 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Only check
382 copy constructors and copy assignment operators proper.
384 2008-07-21 Rafael Avila de Espindola <espindola@google.com>
386 * parser.c (cp_token): Remove in_system_header.
387 (eof_token): Remove in_system_header.
388 (cp_lexer_get_preprocessor_token): Don't set in_system_header.
389 (cp_lexer_set_source_position_from_token): Don't set in_system_header.
390 (cp_parser_member_declaration): Use in_system_header_at.
391 * pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
392 (pop_tinst_level): Don't set in_system_header.
393 (instantiate_class_template): Don't set in_system_header.
394 (instantiate_decl): Don't set in_system_header.
395 (instantiate_pending_templates): Don't set in_system_header.
397 2008-07-21 Paolo Carlini <paolo.carlini@oracle.com>
400 * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
401 TYPE_NOTHROW_P, not TREE_NOTHROW.
402 (trait_expr_value): Likewise.
404 2008-07-18 Dodji Seketeli <dseketel@redhat.com>
407 * call.c (convert_like_real): Don't take the error code path
408 when a rvalue or base conversion has the bad_p field set.
410 2008-07-18 Kris Van Hees <kris.van.hees@oracle.com>
412 * rtti.c (emit_support_tinfos): Add char16_type_node and
414 * typeck2.c (digest_init): Support char16_t and char32_t.
416 2008-07-18 Kavih R. Ghazi <ghazi@caip.rutgers.edu>
418 * cvt.c (convert_to_void): Avoid C++ keywords.
419 * decl.c (walk_namespaces_r, wrapup_globals_for_namespace):
421 * friend.c (is_friend): Likewise.
422 * init.c (perform_member_init): Likewise.
423 * mangle.c (write_template_prefix, write_template_template_param):
425 * name-lookup.c (do_namespace_alias, do_using_directive,
426 parse_using_directive, ambiguous_decl, arg_assoc): Likewise.
427 * parser.c (cp_parser_template_id, cp_parser_namespace_definition,
428 cp_parser_objc_typename, cp_parser_objc_method_keyword_params):
430 * pt.c (is_specialization_of_friend, lookup_template_class,
431 push_tinst_level, instantiate_class_template,
432 tsubst_copy_and_build): Likewise.
433 * tree.c (add_stmt_to_compound): Likewise.
434 * typeck.c (finish_class_member_access_expr): Likewise.
436 2008-07-17 Julian Brown <julian@codesourcery.com>
437 Mark Mitchell <mark@codesourcery.com>
439 * decl2.c (determine_visibility): Allow target to override
440 visibility of class data.
442 2008-07-17 Paolo Carlini <paolo.carlini@oracle.com>
445 * semantics.c (trait_expr_value): Update __has_trivial_destructor
446 semantics to the current WP (N2691).
448 2008-07-16 Dodji Seketeli <dseketel@redhat.com>
451 * name-lookup.c (lookup_extern_c_fun_binding_in_all_ns): New function.
452 (pushdecl_maybe_friend): Check if a redeclaration of extern C function
453 complies with exception specification constraints.
455 2008-07-14 Jason Merrill <jason@redhat.com>
457 * lex.c (init_reswords): Always set D_OBJC.
459 2008-07-11 Tom Tromey <tromey@redhat.com>
460 Ian Lance Taylor <iant@google.com>
462 * lex.c (struct resword, reswords): Don't define.
463 (D_EXT, D_ASM, D_OBJC, D_CXX0X): Don't define.
464 (init_reswords): Clarify mask code. Use c_common_reswords rather
467 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
470 * decl.c (grokdeclarator): Warn about initializing variables
471 of storage class 'extern' only after the type of the declarator
472 has been properly computed.
474 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
477 * cp-tree.h (struct cp_decl_specifier_seq): Add a location field. It
478 carries the location of the primary type.
479 * parser.c (cp_parser_check_type_definition): Update documentation.
480 (cp_parser_check_for_definition_in_return_type,
481 cp_parser_check_for_invalid_template_id,
482 cp_parser_set_decl_spec_type,
483 cp_parser_check_for_definition_in_return_type,
484 cp_parser_diagnose_invalid_type_name,
485 cp_parser_new_expression, cp_parser_explicit_instantiation,
486 cp_parser_type_specifier, cp_parser_simple_type_specifier,
487 cp_parser_omp_for_loop, cp_parser_pragma): Use location in error
490 2008-07-11 Dodji Seketeli <dseketel@redhat.com>
494 * semantic.c (qualified_name_lookup_error, finish_id_expression):
495 Add a location_t parameter so that
496 error message can have a more accurate location.
497 * cp-tree.h: Updated prototype
498 * pt.c (tsubst_qualified_id): Use location in error messages.
499 * parser.c (cp_parser_postfix_expression,
500 cp_parser_objc_statement, cp_parser_trait_expr,
501 cp_parser_token_is_class_key,
502 cp_parser_uncommitted_to_tentative_parse_p,
503 cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
504 cp_parser_error, cp_parser_name_lookup_error,
505 cp_parser_simulate_error, cp_parser_check_decl_spec,
506 cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
507 cp_parser_diagnose_invalid_type_name,
508 cp_parser_parse_and_diagnose_invalid_type_name,
509 cp_parser_require_pragma_eol, cp_parser_make_typename_type,
510 cp_parser_string_literal, cp_parser_primary_expression,
511 cp_parser_primary_expression, cp_parser_unqualified_id,
512 cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
513 cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
514 cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
515 cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
516 cp_parser_jump_statement, cp_parser_block_declaration,
517 cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
518 cp_parser_function_specifier_opt, cp_parser_decltype,
519 cp_parser_mem_initializer_list, cp_parser_mem_initializer,
520 cp_parser_mem_initializer_id, cp_parser_template_parameter,
521 cp_parser_type_parameter, cp_parser_template_id,
522 cp_parser_template_name, cp_parser_template_argument): Likewise.
524 2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
527 * pt.c (tsubst_function_type): Remove warning for type qualifiers
528 on function return type.
530 2008-07-09 Paolo Carlini <paolo.carlini@oracle.com>
533 * pt.c (tsubst_function_type): Don't warn for type qualifiers
534 on function return type in case of system header.
536 2008-07-09 Raksit Ashok <raksit@google.com>
538 * parser.c (cp_parser_postfix_expression): New warning based on flag
539 warn_disallowed_functions.
541 2008-07-08 Simon Martin <simartin@users.sourceforge.net>
544 * decl.c (grokdeclarator): Reset storage_class and staticp for friend
545 functions declared with a storage class qualifier.
547 2008-07-03 Richard Guenther <rguenther@suse.de>
550 * typeck.c (cp_build_function_call): Move code to verify
551 builtin function arguments ...
552 * call.c (build_cxx_call): ... here.
554 2008-07-02 Jason Merrill <jason@redhat.com>
556 * Make-lang.in (cp/typeck2.o): Add $(REAL_H) dependency.
558 Implement WG21 N2672, Initializer List proposed wording
559 * cp-tree.h (enum cp_tree_index): Add CPTI_INIT_LIST_TYPE.
560 (struct lang_type_class): Add has_list_ctor bitfield.
561 (TYPE_HAS_LIST_CTOR): New macro.
562 (BRACE_ENCLOSED_INITIALIZER_P): Expect init_list_type_node.
563 (CONSTRUCTOR_IS_DIRECT_INIT): New macro.
564 (LOOKUP_NO_NARROWING): New macro.
565 (LOOKUP_NO_COPY_CTOR_CONVERSION): New macro.
566 * parser.c (cp_parse_braced_list): Split out from...
567 (cp_parser_initializer_clause): ...here.
568 (cp_parser_postfix_expression): Build up CONSTRUCTOR for compound
570 (cp_lexer_next_token_is_not_keyword): New fn.
571 (cp_parser_parenthesized_expression_list): Handle { }.
572 (cp_parser_new_expression, cp_parser_new_initializer): Likewise.
573 (cp_parser_assignment_expression, cp_parser_condition): Likewise.
574 (cp_parser_jump_statement, cp_parser_simple_declaration): Likewise.
575 (cp_parser_mem_initializer, cp_parser_init_declarator): Likewise.
576 (cp_parser_initializer, cp_parser_functional_cast): Likewise.
577 (cp_parser_omp_for_loop, cp_parser_cache_group): Likewise.
578 (cp_parser_save_member_function_body): Likewise.
579 * call.c (conversion_kind): Add ck_list, ck_aggr.
580 (struct conversion): Add check_narrowing bitfield, conversion list.
581 (build_list_conv): New fn.
582 (build_aggr_conv): New fn.
583 (implicit_conversion): Call them.
584 (standard_conversion): Set check_narrowing if appropriate.
585 (add_function_candidate): Handle LOOKUP_NO_COPY_CTOR_CONVERSION.
586 (build_user_type_conversion_1): When converting from an init list,
587 we allow additional conversions except when calling a copy ctor.
588 (convert_like_real): Calling an explicit ctor for an init list is
589 ill-formed. Handle ck_list and ck_addr. Check narrowing.
590 (build_new_method_call): If CONSTRUCTOR_IS_DIRECT_INIT is set and
591 class doesn't have a list ctor, break the {} into a TREE_LIST.
592 (compare_ics): ck_list is better than other UDCs.
593 (set_up_extended_ref_temp): Split out from initialize_reference.
594 (is_std_init_list): New fn.
595 (is_list_ctor): New fn.
596 * decl.c (cxx_init_decl_processing): Create init_list_type_node.
597 (reshape_init_array_1): Pass it to build_constructor.
598 (reshape_init_class): Ditto.
599 (initialize_artificial_var): Pass the appropriate type.
600 (build_aggr_init_full_exprs): Split out from...
601 (check_initializer): ...here. Handle new semantics.
602 (build_init_list_var_init): New subroutine of check_initializer.
603 (grokdeclarator): Converting constructors can have more than one parm.
604 (grok_special_member_properties): Set TYPE_HAS_LIST_CTOR.
605 * init.c (expand_default_init): Only do digest_init for aggregates.
606 * rtti.c (tinfo_base_init): Pass init_list_type_node to
607 build_constructor_from_list.
608 (generic_initializer, ptr_initializer): Ditto.
609 (ptm_initializer, class_initializer): Ditto.
610 (get_pseudo_ti_init): Ditto.
611 * error.c (dump_type): Handle init_list_type_node.
612 (maybe_warn_cpp0x): New fn.
613 (maybe_varn_variadic_templates): Call it.
614 * cvt.c (ocp_convert): Handle conversion from { }.
615 * tree.c (build_array_of_n_type): New fn.
616 * typeck2.c (store_init_value): Use init_list_type_node.
617 (digest_init): Likewise.
618 (check_narrowing): New fn.
619 * semantics.c: (finish_compound_literal): Take CONSTRUCTOR instead
620 of vector of constructor elts. Handle non-aggregate types. Make
621 constant literals static.
622 * pt.c: (tsubst_copy_and_build): Adjust.
624 * name-lookup.c (arg_assoc_type): Handle init_list_type_node.
626 2008-07-01 Daniel Jacobowitz <dan@codesourcery.com>
628 * typeck.c (comp_ptr_ttypes_real): Use vector_targets_convertible_p.
629 (comp_ptr_ttypes_const): Likewise.
631 2008-07-01 Andrew Haley <aph@redhat.com>
633 * decl.c (finish_constructor_body): Don't set the return value of
634 the constructor if the constructor is that of a Java type.
636 2008-06-30 Jakub Jelinek <jakub@redhat.com>
639 * decl2.c (is_late_template_attribute): If the first attribute
640 argument is IDENTIFIER_NODE, don't consider it when checking
641 if arguments are value or type dependent.
643 2008-06-29 Paolo Carlini <paolo.carlini@oracle.com>
646 * pt.c (do_type_instantiation): In c++0x mode do not warn for
649 2008-06-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
651 * Make-lang.in (cp-warn): Delete $(CXX_COMPAT_WARN).
653 2008-06-28 Jakub Jelinek <jakub@redhat.com>
656 * repo.c (repo_emit_p): Put const static data members initialized
657 by const expr into *.rpo file, just return 2 if IDENTIFIER_REPO_CHOSEN
660 2008-06-27 Paolo Carlini <paolo.carlini@oracle.com>
663 * pt.c (do_decl_instantiation): In c++0x mode do not warn for
666 2008-06-24 Jonathan Wakely <jwakely.gcc@gmail.com>
669 * typeck.c (cp_build_function_call): Show example syntax in
672 2008-06-21 Jonathan Wakely <jwakely.gcc@gmail.com>
674 * typeck.c (composite_pointer_type_r, cxx_sizeof_expr,
675 cxx_alignof_expr, check_template_keyword, cp_build_binary_op,
676 pointer_diff, cp_build_unary_op, build_x_compound_expr_from_list,
677 build_reinterpret_cast_1, cp_build_c_cast, check_return_expr): Change
678 pedwarn to permerror.
679 * init.c (perform_member_init, build_new_1, build_new): Likewise.
680 * decl.c (warn_extern_redeclared_static, duplicate_decls,
681 * identify_goto, check_previous_goto_1, check_goto, define_label,
682 check_tag_decl, start_decl, check_class_member_definition_namespace,
683 grokfndecl, grokdeclarator): Likewise.
684 * except.c (check_handlers): Likewise.
685 * typeck2.c (digest_init): Likewise.
686 * pt.c (check_specialization_namespace,
687 check_explicit_instantiation_namespace,
688 maybe_process_partial_specialization, check_explicit_specialization,
689 convert_template_argument, do_decl_instantiation,
690 do_type_instantiation, instantiate_decl): Likewise.
691 * semantics.c (finish_template_type_parm): Likewise.
692 * name-lookup.c (pushdecl_maybe_friend,
693 check_for_out_of_scope_variable): Likewise.
694 * decl2.c (finish_static_data_member_decl, build_anon_union_vars,
695 coerce_new_type): Likewise.
696 * parser.c (cp_parser_nested_name_specifier_opt,
697 cp_parser_mem_initializer, cp_parser_elaborated_type_specifier,
698 cp_parser_class_head, cp_parser_check_class_key): Likewise.
699 (cp_parser_parameter_declaration): Check flag_permissive instead of
700 flag_pedantic_errors.
701 * call.c (joust): Change pedwarn to warning.
702 * friend.c (make_friend_class): Likewise.
704 2008-06-16 Jan Hubicka <jh@suse.cz>
706 * method.c: Include cgraph.h.
707 (use_thunk): Use cgraph_add_new_function instead of calling backend
710 2008-06-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
712 * parser.c: Fix comment typo.
714 2008-06-14 Simon Martin <simartin@users.sourceforge.net>
717 * decl2.c (grokbitfield): Receive the list of attributes, pass it to
718 grokdeclarator and apply it to the created declaration.
719 * cp-tree.h (grokbitfield): Update prototype.
720 * parser.c (cp_parser_member_declaration): Don't apply the attributes
721 since they are now applied in grokbitfield. Adjusted the call to
723 (cp_parser_objc_class_ivars): Likewise.
725 2008-06-14 Simon Martin <simartin@users.sourceforge.net>
728 * class.c (type_requires_array_cookie): Do not consider delete[]
729 operators with an ellipsis as second argument.
731 2008-06-09 Jakub Jelinek <jakub@redhat.com>
734 * semantics.c (stmt_expr_value_expr): Don't crash on empty
737 2008-06-08 Paolo Carlini <paolo.carlini@oracle.com>
740 * pt.c (maybe_process_partial_specialization): Check the tree
741 returned by push_template_decl for error_mark_node.
742 * parser.c (cp_parser_class_head): Likewise, check the tree
743 returned by the latter.
745 2008-06-07 Paolo Carlini <paolo.carlini@oracle.com>
748 * decl.c (grokdeclarator): In case of wrong return type return
749 immediately error_mark_node.
751 2008-06-06 Jakub Jelinek <jakub@redhat.com>
753 * cp-tree.h (cxx_omp_finish_clause, cxx_omp_create_clause_info,
754 dependent_omp_for_p, begin_omp_task, finish_omp_task,
755 finish_omp_taskwait): New prototypes.
756 (cxx_omp_clause_default_ctor): Add outer argument.
757 (finish_omp_for): Add new clauses argument.
758 * cp-gimplify.c (cxx_omp_finish_clause): New function.
759 (cxx_omp_predetermined_sharing): Moved from semantics.c, rewritten.
760 (cxx_omp_clause_default_ctor): Add outer argument.
761 (cp_genericize_r): Walk OMP_CLAUSE_LASTPRIVATE_STMT.
762 * cp-objcp-common.h (LANG_HOOKS_OMP_FINISH_CLAUSE): Define.
763 * parser.c (cp_parser_omp_for_loop): Parse collapsed for loops.
764 Add par_clauses argument. If decl is present in parallel's
765 lastprivate clause, change that clause to shared and add
766 a lastprivate clause for decl to OMP_FOR_CLAUSES.
767 Fix wording of error messages. Adjust finish_omp_for caller.
768 Add clauses argument. Parse loops with random access iterators.
769 (cp_parser_omp_clause_collapse, cp_parser_omp_clause_untied): New
771 (cp_parser_omp_for, cp_parser_omp_parallel): Adjust
772 cp_parser_omp_for_loop callers.
773 (cp_parser_omp_for_cond, cp_parser_omp_for_incr): New helper
775 (cp_parser_omp_clause_name): Handle collapse and untied
777 (cp_parser_omp_clause_schedule): Handle auto schedule.
778 (cp_parser_omp_all_clauses): Handle PRAGMA_OMP_CLAUSE_COLLAPSE
779 and PRAGMA_OMP_CLAUSE_UNTIED.
780 (OMP_FOR_CLAUSE_MASK): Add PRAGMA_OMP_CLAUSE_COLLAPSE.
781 (OMP_TASK_CLAUSE_MASK): Define.
782 (cp_parser_omp_task, cp_parser_omp_taskwait): New functions.
783 (cp_parser_omp_construct): Handle PRAGMA_OMP_TASK.
784 (cp_parser_pragma): Handle PRAGMA_OMP_TASK and
786 * pt.c (tsubst_omp_clauses): Handle OMP_CLAUSE_COLLAPSE and
787 OMP_CLAUSE_UNTIED. Handle OMP_CLAUSE_LASTPRIVATE_STMT.
788 (tsubst_omp_for_iterator): New function.
789 (dependent_omp_for_p): New function.
790 (tsubst_expr) <case OMP_FOR>: Use it. Handle collapsed OMP_FOR
791 loops. Adjust finish_omp_for caller. Handle loops with random
792 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR} changes.
793 (tsubst_expr): Handle OMP_TASK.
794 * semantics.c (cxx_omp_create_clause_info): New function.
795 (finish_omp_clauses): Call it. Handle OMP_CLAUSE_UNTIED and
797 (cxx_omp_predetermined_sharing): Removed.
798 * semantics.c (finish_omp_for): Allow pointer iterators. Use
799 handle_omp_for_class_iterator and dependent_omp_for_p. Handle
800 collapsed for loops. Adjust c_finish_omp_for caller. Add new
801 clauses argument. Fix check for type dependent cond or incr.
802 Set OMP_FOR_CLAUSES to clauses. Use cp_convert instead of
803 fold_convert to convert incr amount to difference_type. Only
804 fold if not in template. If decl is mentioned in lastprivate
805 clause, set OMP_CLAUSE_LASTPRIVATE_STMT. Handle loops with random
806 access iterators. Adjust for OMP_FOR_{INIT,COND,INCR}
808 (finish_omp_threadprivate): Allow static class members of the
810 (handle_omp_for_class_iterator, begin_omp_task, finish_omp_task,
811 finish_omp_taskwait): New functions.
813 * parser.c (cp_parser_binary_expression): Add prec argument.
814 (cp_parser_assignment_expression): Adjust caller.
815 * cp-tree.h (outer_curly_brace_block): New prototype.
816 * decl.c (outer_curly_brace_block): No longer static.
818 2008-06-02 Paolo Carlini <paolo.carlini@oracle.com>
821 * pt.c (push_template_decl_real): Consistently return error_mark_node
824 2008-06-02 Tomas Bily <tbily@suse.cz>
826 * typeck.c (is_bitfield_expr_with_lowered_type): Use CASE_CONVERT.
827 (cp_build_unary_op): Likewise.
828 (cp_build_indirect_ref): Use CONVERT_EXPR_P.
829 (maybe_warn_about_returning_address_of_local): Likewise.
831 2008-05-29 Paolo Carlini <paolo.carlini@oracle.com>
834 * pt.c (tsubst_initializer_list): Consistently check the tree
835 returned by tsubst_pack_expansion for error_mark_node.
837 2008-05-27 Michael Matz <matz@suse.de>
840 * call.c (build_new_op): Make warning conditional on
843 2008-05-27 Alexandre Oliva <aoliva@redhat.com>
846 * call.c (convert_like_real): Convert bitfield to desired type
847 before creating temporary.
849 2008-05-26 Daniel Franke <franke.daniel@gmail.com>
851 * Makefile.in: Adjusted dependencies on c-incpath.o.
853 2008-05-23 Jakub Jelinek <jakub@redhat.com>
856 * cp-gimplify.c (cxx_omp_clause_apply_fn): Call
857 fold_build_cleanup_point_expr on build_call_a results.
860 * semantics.c (omp_clause_info_fndecl): New function.
861 (finish_omp_clauses): Use it.
863 2008-05-21 Jakub Jelinek <jakub@redhat.com>
866 * cp-tree.h (check_array_initializer): New prototype.
867 * decl.c (check_array_initializer): New function.
868 (check_initializer): Call it.
869 * semantics.c (finish_compound_literal): Call it for ARRAY_TYPEs.
871 2008-05-21 Tom Tromey <tromey@redhat.com>
873 * mangle.c (save_partially_mangled_name): Remove.
874 (restore_partially_mangled_name): Likewise.
875 (write_encoding): Update.
876 (write_unqualified_name): Likewise.
877 (start_mangling): Always use name_obstack. Remove 'ident_p'
879 (get_identifier_nocopy): Remove.
880 (finish_mangling_internal): Rename from finish_mangling.
881 (finish_mangling): New function.
882 (finish_mangling_get_identifier): Likewise.
883 (partially_mangled_name, partially_mangled_name_len): Remove.
884 (mangle_decl_string): Change return type. Update.
885 (mangle_decl, mangle_type_string, mangle_special_for_type,
886 mangle_ctor_vtbl_for_type, mangle_thunk, mangle_guard_variable,
887 mangle_ref_init_variable): Update.
889 2008-05-12 Paolo Carlini <paolo.carlini@oracle.com>
892 * semantics.c (begin_class_definition): Extend checks on the first
895 2008-05-12 Tomas Bily <tbily@suse.cz>
897 * typeck2.c (digest_init): Use CONVERT_EXPR_P.
898 * call.c (build_over_call): Likewise.
899 * error.c (dump_expr): Use CASE_CONVERT.
900 * class.c (fixed_type_or_null): Likewise.
902 2008-05-11 Volker Reichelt <v.reichelt@netcologne.de>
904 * parser.c (cp_parser_omp_clause_reduction): Add missing "expected"
906 (cp_parser_omp_clause_schedule): Remove superfluous "expected"
909 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
911 * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
912 DECL_LOOPING_CONST_OR_PURE_P attributes.
913 * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
916 2008-05-02 Simon Baldwin <simonb@google.com>
919 * typeck.c (build_array_ref): Remove warn_array_subscript_range.
921 2008-05-01 Simon Baldwin <simonb@google.com>
923 * typeck.c (build_array_ref): Call warn_array_subscript_range.
925 2008-04-30 Jakub Jelinek <jakub@redhat.com>
928 * pt.c (more_specialized_fn): Stop the loop even if there are no
929 arguments before ellipsis.
931 2008-04-29 Jakub Jelinek <jakub@redhat.com>
934 * parser.c (cp_parser_lookup_name): Look through single function
938 * typeck.c (cp_build_modify_expr) <case PREINCREMENT_EXPR>: Don't build
939 COMPOUND_EXPR if the second argument would be error_mark_node.
941 2008-04-28 Jason Merrill <jason@redhat.com>
942 Liu Guanwei <liu_gw@163.com>
945 * parser.c (cp_parser_parameter_declaration): Handle < ambiguity
946 in default arguments.
948 2008-04-25 Jan Hubicka <jh@suse.cz>
950 * typeck.c (check_return_expr): Update.
951 * decl.c (start_preparsed_function): Update.
952 * method.c (use_thunk): Update.
954 2008-04-24 Jakub Jelinek <jakub@redhat.com>
957 * cp-tree.h (cp_reconstruct_complex_type): New prototype.
958 * cp-objcp-common.h (LANG_HOOKS_RECONSTRUCT_COMPLEX_TYPE): Define.
959 * decl2.c (is_late_template_attribute): Only make vector_size
960 late tmpl attribute if argument is type or value dependent.
961 (cp_reconstruct_complex_type): New function.
963 2008-04-24 Richard Guenther <rguenther@suse.de>
965 * typeck.c (cp_build_function_call): Call
966 check_builtin_function_arguments.
968 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
970 * typeck.c (get_member_function_from_ptrfunc): Don't set TREE_INVARIANT.
971 (build_ptrmemfunc1): Don't set TREE_INVARIANT.
972 * init.c (build_zero_init): Don't set TREE_INVARIANT.
973 * class.c (build_base_path): Don't set TREE_INVARIANT.
974 (build_vtbl_ref_1): Don't set TREE_INVARIANT.
975 (build_vtbl_initializer): Don't set TREE_INVARIANT.
976 * decl.c (build_enumerator): Don't set TREE_INVARIANT.
977 * rtti.c (tinfo_base_init): Don't set TREE_INVARIANT.
978 (generic_initializer): Don't set TREE_INVARIANT.
979 (ptr_initializer): Don't set TREE_INVARIANT.
980 (ptm_initializer): Don't set TREE_INVARIANT.
981 (class_initializer): Don't set TREE_INVARIANT.
982 * typeck2.c (process_init_constructor): Don't set TREE_INVARIANT.
983 * pt.c (push_inline_template_parms_recursive): Don't set TREE_INVARIANT.
984 (build_template_parm_index): Don't set TREE_INVARIANT.
985 (reduce_template_parm_level): Don't set TREE_INVARIANT.
986 (process_template_parm): Don't set TREE_INVARIANT.
988 2008-04-22 Jason Merrill <jason@redhat.com>
991 * semantics.c (finish_decltype_type): Check DECL_BIT_FIELD_TYPE
992 to see if DECL_BIT_FIELD_TYPE should be used, not some other flag.
993 * typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
995 2008-04-22 Jakub Jelinek <jakub@redhat.com>
998 * semantics.c (finish_stmt_expr): Call pop_stmt_list even if the stmt
999 expression is errorneous.
1001 2008-04-21 Jason Merrill <jason@redhat.com>
1004 * tree.c (cp_tree_equal): Handle FIXED_CST.
1007 * pt.c (template_template_parm_bindings_ok_p): Set
1008 processing_template_decl while in this function.
1010 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1012 * cvt.c (type_promotes_to): Support char16_t and char32_t.
1013 * decl.c (grokdeclarator): Disallow signed/unsigned/short/long on
1014 char16_t and char32_t.
1015 * lex.c (reswords): Add char16_t and char32_t (for c++0x).
1016 * mangle.c (write_builtin_type): Mangle char16_t/char32_t as vendor
1017 extended builtin type "u8char{16,32}_t".
1018 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Support
1020 (cp_lexer_print_token): Support CPP_STRING{16,32}.
1021 (cp_parser_is_string_literal): Idem.
1022 (cp_parser_string_literal): Idem.
1023 (cp_parser_primary_expression): Support CPP_CHAR{16,32} and
1025 (cp_parser_simple_type_specifier): Support RID_CHAR{16,32}.
1026 * tree.c (char_type_p): Support char16_t and char32_t as char types.
1027 * typeck.c (string_conv_p): Support char16_t and char32_t.
1029 2008-04-17 Jason Merrill <jason@redhat.com>
1032 * call.c (build_user_type_conversion_1): Represent second step of
1033 copy-init with an rvalue conversion.
1034 (convert_like_real) [ck_user]: Don't implicitly add it here.
1036 2008-04-15 Jakub Jelinek <jakub@redhat.com>
1039 * decl.c (layout_var_decl): If extern or static var has variable
1040 size, set TREE_TYPE (decl) to error_mark_node.
1042 2008-04-16 Danny Smith <dannysmith@users.sourceforge.net>
1045 * optimize.c (maybe_clone_body): Copy DECL_DLLIMPORT_P flag
1048 2008-04-09 Jason Merrill <jason@redhat.com>
1051 * semantics.c (finish_compound_literal): Return a TARGET_EXPR,
1052 not a pushed variable.
1054 2008-04-09 Volker Reichelt <v.reichelt@netcologne.de>
1056 * call.c (build_op_delete_call): Fix quotation in warning message.
1057 * decl.c (grokdeclarator): Quote keyword in error message.
1058 * pt.c (check_for_bare_parameter_packs): Fix quotation in error
1061 * parser.c (cp_parser_check_type_definition): Print error string
1062 directly rather than using "%s".
1063 (cp_parser_postfix_expression): Fix quotation.
1064 (cp_parser_decltype): Likewise.
1065 (cp_parser_sizeof_operand): Fix quotation. Simplify.
1067 * parser.c (cp_parser_non_integral_constant_expression): Build error
1068 message with CONCAT rather than using "%s".
1069 (cp_parser_primary_expression): Fix quotation.
1070 (cp_parser_postfix_expression): Likewise.
1071 (cp_parser_postfix_dot_deref_expression): Likewise.
1072 (cp_parser_unary_expression): Likewise.
1073 (cp_parser_new_expression): Likewise.
1074 (cp_parser_delete_expression): Likewise.
1076 * parser.c (cp_parser_asm_specification_opt): Print CPP_CLOSE_PAREN
1077 as `)', not as `('. Fix quotation.
1078 (cp_parser_consume_semicolon_at_end_of_statement): Fix quotation.
1079 (cp_parser_primary_expression): Likewise.
1080 (cp_parser_nested_name_specifier_opt): Likewise.
1081 (cp_parser_postfix_expression): Likewise.
1082 (cp_parser_postfix_open_square_expression): Likewise.
1083 (cp_parser_parenthesized_expression_list): Likewise.
1084 (cp_parser_pseudo_destructor_name): Likewise.
1085 (cp_parser_new_expression): Likewise.
1086 (cp_parser_direct_new_declarator): Likewise.
1087 (cp_parser_delete_expression): Likewise.
1088 (cp_parser_cast_expression): Likewise.
1089 (cp_parser_question_colon_clause): Likewise.
1090 (cp_parser_builtin_offsetof): Likewise.
1091 (cp_parser_trait_expr): Likewise.
1092 (cp_parser_label_for_labeled_statement): Likewise.
1093 (cp_parser_compound_statement): Likewise.
1094 (cp_parser_selection_statement): Likewise.
1095 (cp_parser_condition): Likewise.
1096 (cp_parser_iteration_statement): Likewise.
1097 (cp_parser_already_scoped_statement): Likewise.
1098 (cp_parser_simple_declaration): Likewise.
1099 (cp_parser_linkage_specification): Likewise.
1100 (cp_parser_static_assert): Likewise.
1101 (cp_parser_decltype): Likewise.
1102 (cp_parser_conversion_function_id): Likewise.
1103 (cp_parser_operator_function_id): Likewise.
1104 (cp_parser_operator): Likewise.
1105 (cp_parser_type_parameter): Likewise.
1106 (cp_parser_template_id): Likewise.
1107 (cp_parser_explicit_instantiation): Likewise.
1108 (cp_parser_explicit_specialization): Likewise.
1109 (cp_parser_enum_specifier): Likewise.
1110 (cp_parser_namespace_definition): Likewise.
1111 (cp_parser_namespace_alias_definition): Likewise.
1112 (cp_parser_using_declaration): Likewise.
1113 (cp_parser_using_directive): Likewise.
1114 (cp_parser_asm_definition): Likewise.
1115 (cp_parser_direct_declarator): Likewise.
1116 (cp_parser_ptr_operator): Likewise.
1117 (cp_parser_parameter_declaration_clause): Likewise.
1118 (cp_parser_initializer_clause): Likewise.
1119 (cp_parser_class_specifier): Likewise.
1120 (cp_parser_member_specification_opt): Likewise.
1121 (cp_parser_member_declaration): Likewise.
1122 (cp_parser_pure_specifier): Likewise.
1123 (cp_parser_constant_initializer): Likewise.
1124 (cp_parser_base_clause): Likewise.
1125 (cp_parser_exception_specification_opt): Likewise.
1126 (cp_parser_try_block): Likewise.
1127 (cp_parser_function_try_block): Likewise.
1128 (cp_parser_handler): Likewise.
1129 (cp_parser_throw_expression): Likewise.
1130 (cp_parser_asm_operand_list): Likewise.
1131 (cp_parser_attributes_opt): Likewise.
1132 (cp_parser_label_declaration): Likewise.
1133 (cp_parser_constructor_declarator_p): Likewise.
1134 (cp_parser_template_declaration_after_export): Likewise.
1135 (cp_parser_single_declaration): Likewise.
1136 (cp_parser_objc_message_expression): Likewise.
1137 (cp_parser_objc_message_args): Likewise.
1138 (cp_parser_objc_encode_expression): Likewise.
1139 (cp_parser_objc_defs_expression): Likewise.
1140 (cp_parser_objc_protocol_expression): Likewise.
1141 (cp_parser_objc_selector_expression): Likewise.
1142 (cp_parser_objc_protocol_refs_opt): Likewise.
1143 (cp_parser_objc_typename): Likewise.
1144 (cp_parser_objc_method_keyword_params): Likewise.
1145 (cp_parser_objc_superclass_or_category): Likewise.
1146 (cp_parser_objc_try_catch_finally_statement): Likewise.
1147 (cp_parser_objc_synchronized_statement): Likewise.
1148 (cp_parser_objc_throw_statement): Likewise.
1149 (cp_parser_omp_var_list_no_open): Likewise.
1150 (cp_parser_omp_clause_default): Likewise.
1151 (cp_parser_omp_clause_if): Likewise.
1152 (cp_parser_omp_clause_num_threads): Likewise.
1153 (cp_parser_omp_clause_reduction): Likewise.
1154 (cp_parser_omp_clause_schedule): Likewise.
1155 (cp_parser_omp_critical): Likewise.
1156 (cp_parser_omp_for_loop): Likewise.
1157 (cp_parser_omp_sections_scope): Likewise.
1159 * parser.c (cp_parser_template_parameter_list): Simplify.
1161 2008-04-07 James E. Wilson <wilson@tuliptree.org>
1163 * pt.c (tsubst_copy, case SIZEOF_EXPR): Initialize len.
1165 2008-04-07 Jason Merrill <jason@redhat.com>
1168 * class.c (type_has_user_nondefault_constructor): A template
1169 counts as a nondefault constructor.
1171 2008-04-04 Paolo Bonzini <bonzini@gnu.org>
1173 * decl.c (cxx_push_function_context): Delete.
1174 (cxx_pop_function_context): Delete.
1175 (start_preparsed_function): Merge cxx_push_function_context (!f->decl
1177 * cp-objcp-common.h (LANG_HOOKS_FUNCTION_INIT,
1178 LANG_HOOKS_FUNCTION_FINAL): Delete.
1179 (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P): Rename to
1180 LANG_HOOKS_MISSING_NORETURN_OK_P.
1181 * cp-tree.h (cxx_push_function_context, cxx_pop_function_context):
1183 * semantics.c (current_stmt_tree): Fix comment.
1185 2008-04-03 Jakub Jelinek <jakub@redhat.com>
1188 * semantics.c (finish_offsetof): Undo effect of convert_from_reference
1189 before calling fold_offsetof.
1191 2008-04-03 Tom Tromey <tromey@redhat.com>
1193 * Make-lang.in (c++_OBJS): New variable.
1195 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
1197 * optimize.c (clone_body): New, from tree-inline.c.
1199 2008-04-03 Paolo Bonzini <bonzini@gnu.org>
1201 * method.c (synthesize_method): Use {push,pop}_function_context.
1202 * name-lookup.c (push_to_top_level): Likewise.
1203 * parser.c (cp_parser_late_parsing_for_member): Likewise.
1205 2008-03-30 Volker Reichelt <v.reichelt@netcologne.de>
1208 * parser.c (cp_parser_decl_specifier_seq): Add location to error
1211 2008-03-27 Tom Tromey <tromey@redhat.com>
1213 * Make-lang.in: Revert automatic dependency patch.
1215 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
1218 * typeck.c (build_x_compound_expr): Use cp_build_compound_expr.
1219 (build_compound_expr): New, for compatibility with C
1220 build_compound_expr.
1221 (cp_build_compound_expr): Renamed from build_compound_expr.
1222 (build_c_cast): New, for compatibility with C build_c_cast.
1223 (cp_build_c_cast): Renamed from build_c_cast.
1224 * init.c (build_vec_delete_1): Fix calls to build_compound_expr.
1225 * decl.c (cxx_maybe_build_cleanup): Ditto.
1226 * cp-tree.h (build_compound_expr): Add C-compatibile prototype.
1227 (cp_build_compound_expr): Renamed from build_compound_expr.
1228 (build_c_cast): Add C-compatible prototype.
1229 (cp_build_c_cast): Renamed from build_c_cast.
1230 * typeck2.c (build_functional_cast): Use cp_build_c_cast.
1231 * parser.c (cp_parser_cast_expression): Fix call to build_c_cast.
1233 2008-03-27 Douglas Gregor <doug.gregor@gmail.com>
1235 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Cope with
1236 tsubst_pack_expansion returning a pack expansion, or a TREE_VEC
1237 ending in a pack expansion, both of which can occur when
1238 substituting into a nested template.
1239 (tsubst_copy_and_build) <case SIZEOF_EXPR>: When we're
1240 instantiating the sizeof...(X) form, make tsubst_copy do the work.
1241 * parser.c (cp_parser_template_parameter): Deal with unnamed
1242 non-type template parameter packs identified by pack expansions in
1245 2008-03-26 Jakub Jelinek <jakub@redhat.com>
1248 * pt.c (apply_late_template_attributes): Don't call tsubst on
1249 first attribute argument if it is IDENTIFIER_NODE.
1252 * error.c (dump_expr): Pass {,UN}ORDERED_EXPR, UN{LT,LE,GT,GE,EQ}_EXPR
1253 and LTGT_EXPR to pp_expression.
1255 2008-03-26 Douglas Gregor <doug.gregor@gmail.com>
1257 * pt.c (coerce_template_template_parm): Moved the body of the loop
1258 of coerce_template_template_parms here, to make iteration over a
1259 template argument pack simpler.
1260 Also, allow matching of a template parameter pack in the template
1261 template parameter to a template parameter in the template
1263 (coerce_template_template_parms): Deal with variadic template
1264 template parameters. Use coerce_template_template_parm.
1265 (unify): Make sure we coerce the template template argument's
1266 template arguments to the template template parameter's template
1267 parameters, not the other way around.
1269 2008-03-25 Tom Tromey <tromey@redhat.com>
1271 * Make-lang.in: Remove .o targets.
1272 (cp/g++spec.o): Moved to cp/. Reduce to variable setting.
1274 (c++_OBJS): New variable.
1275 (CXX_TREE_H, CXX_PRETTY_PRINT_H): Remove.
1277 2008-03-25 Douglas Gregor <doug.gregor@gmail.com>
1279 * typeck.c (composite_pointer_type_r): Add SFINAE support.
1280 (composite_pointer_type): Ditto.
1281 (common_type): Fix call to composite_pointer_type.
1282 (cxx_sizeof_nowarn): New; used to be a macro.
1283 (cxx_sizeof_expr): Add SFINAE support.
1284 (cxx_alignof_expr): Ditto.
1285 (decay_conversion): Fix calls for SFINAE support.
1286 (rationalize_conditional_expr): Add SFINAE support.
1287 (build_class_member_access_expr): Ditto.
1288 (finish_class_member_access_expr): Ditto.
1289 (build_x_indirect_ref): Ditto.
1290 (build_indirect_ref): Original version renamed to
1291 cp_build_indirect_ref; new version provides a bridge from
1293 (cp_build_indirect_ref): Was build_indirect_ref; added SFINAE
1295 (get_member_function_from_ptrfunc): Fix calls for SFINAE support.
1296 (build_function_call): Original version renamed to
1297 cp_build_function_call; new version provides a bridge from
1299 (cp_build_function_call): Was build_function_call; added SFINAE
1301 (convert_arguments): Add SFINAE support.
1302 (build_x_binary_op): Ditto.
1303 (build_binary_op): Original version renamed to cp_build_binary_op;
1304 new version provides a bridge from c-common.
1305 (cp_build_binary_op): Was build_binary_op; added SFINAE support.
1306 (pointer_diff): Fix calls for SFINAE.
1307 (build_x_unary_op): Add SFINAE support.
1308 (condition_conversion): Fix calls for SFINAE.
1309 (build_unary_op): Original version renamed to cp_build_unary_op;
1310 new version provides a bridge from c-common.
1311 (cp_build_unary_op): Was build_unary_op; added SFINAE support.
1312 (unary_complex_lvalue): Fix calls for SFINAE.
1313 (build_x_conditional_expr): Add SFINAE support.
1314 (build_x_compound_expr_from_list): Fix calls for SFINAE.
1315 (build_x_compound_expr): Add SFINAE support.
1316 (convert_ptrmem): Fix calls for SFINAE.
1317 (build_static_cast_1): Add SFINAE support.
1318 (build_static_cast): Ditto.
1319 (build_reinterpret_cast_1): Ditto.
1320 (build_reinterpret_cast): Ditto.
1321 (build_const_cast_1): Ditto.
1322 (build_const_cast): Ditto.
1323 (build_c_cast): Ditto.
1324 (build_modify_expr): Original version renamed to
1325 cp_build_modify_expr; new version provides a bridge from c-common.
1326 (cp_build_modify_expr): Was build_modify_expr; added SFINAE
1328 (build_x_modify_expr): Add SFINAE support.
1329 (build_ptrmemfunc): Fix calls for SFINAE.
1330 (convert_for_assignment): Add SFINAE support.
1331 (convert_for_initialization): Ditto.
1332 (check_return_expr): Fix calls for SFINAE.
1333 (lvalue_or_else): Add SFINAE support.
1334 * init.c (perform_member_init): Fix calls for SFINAE.
1335 (emit_mem_initializers): Ditto.
1336 (expand_virtual_init): Ditto.
1337 (expand_cleanup_for_base): Ditto.
1338 (build_aggr_init): Add SFINAE support.
1339 (expand_default_init): Ditto.
1340 (expand_aggr_init_1): Fix calls for SFINAE.
1341 (build_offset_ref): Ditto.
1342 (build_new_1): Add SFINAE support.
1344 (build_vec_delete_1): Fix calls for SFINAE.
1345 (get_temp_regvar): Ditto.
1346 (build_vec_init): Add SFINAE support.
1347 (build_dtor_call): Fix calls for SFINAE.
1348 (build_delete): Ditto.
1349 (push_base_cleanups): Ditto.
1350 (build_vec_delete_1): Ditto.
1351 * class.c (build_base_path): Fix calls for SFINAE.
1352 (build_simple_base_path): Ditto.
1353 (convert_to_base_statically): Ditto.
1354 (build_vfn_ref): Ditto.
1355 (resolve_address_of_overloaded_function): Ditto.
1356 * decl.c (check_initializer): Fix calls for SFINAE.
1357 (register_dtor_fn): Ditto.
1358 (compute_array_index_type): Ditto.
1359 (finish_enum): Ditto.
1360 (start_preparsed_function): Ditto.
1361 (cxx_maybe_build_cleanup): Ditto.
1362 * call.c (convert_like): Add COMPLAIN argument.
1363 (convert_like_with_context): Ditto.
1364 (build_this): Fix calls for SFINAE.
1365 (build_user_type_conversion): Ditto.
1366 (resolve_args): Ditto.
1367 (build_new_function_call): Add SFINAE support.
1368 (build_operator_new_call): Fix calls for SFINAE.
1369 (build_object_call): Add SFINAE support.
1370 (build_conditional_expr): Ditto.
1371 (build_new_op): Ditto.
1372 (build_op_delete_call): Fix calls for SFINAE.
1373 (build_temp): Ditto.
1374 (convert_like_real): Add SFINAE support.
1375 (build_x_va_arg): Fix calls for SFINAE.
1376 (convert_default_arg): Ditto.
1377 (build_over_call): Add SFINAE support.
1378 (build_java_interface_fn_ref): Fix calls for SFINAE.
1379 (build_special_member_call): Add SFINAE support.
1380 (build_new_method_call): Ditto.
1381 (perform_implicit_conversion): Ditto.
1382 (perform_direct_initialization_if_possible): Ditto.
1383 (initialize_reference): Fix calls for SFINAE.
1384 * method.c (do_build_assign_ref): Fix calls for SFINAE.
1385 * rtti.c (build_headof): Fix calls for SFINAE.
1386 (get_tinfo_decl_dynamic): Ditto.
1387 (get_typeid): Ditto.
1388 (build_dynamic_cast_1): Add SFINAE support.
1389 (build_dynamic_cast): Ditto.
1390 (tinfo_base_init): Fix calls for SFINAE.
1391 * except.c (do_get_exception_ptr): Fix calls for SFINAE.
1392 (do_end_catch): Ditto.
1393 (initialize_handler_parm): Ditto.
1394 (expand_start_catch_block): Ditto.
1395 (do_allocate_exception): Ditto.
1396 (do_free_exception): Ditto.
1397 (build_throw): Ditto.
1398 * cvt.c (build_up_reference): Fix calls for SFINAE.
1399 (convert_to_reference): Ditto.
1400 (ocp_convert): Ditto.
1401 (convert_to_void): Add SFINAE support.
1402 * tree.c (build_dummy_object): Fix calls for SFINAE.
1403 (stabilize_expr): Ditto.
1404 * cp-tree.h (build_conditional_expr): Add tsubst_flags_t
1406 (build_new_method_call): Ditto.
1407 (build_special_member_call): Ditto.
1408 (build_new_op): Ditto.
1409 (perform_implicit_conversion): Ditto.
1410 (perform_direct_initialization_if_possible): Ditto.
1411 (convert_to_void): Ditto.
1412 (build_aggr_init): Ditto.
1414 (build_vec_init): Ditto.
1415 (build_dynamic_cast): Ditto.
1416 (finish_call_expr): Ditto
1417 (cxx_sizeof_or_alignof_expr): Add COMPLAIN parameter.
1418 (cxx_sizeof_nowarn): Remove macro; add function declaration.
1419 (build_class_member_access_expr): Add tsubst_flags_t parameter.
1420 (finish_class_member_access_expr): Ditto.
1421 (build_x_indirect_ref): Ditto.
1422 (cp_build_indirect_ref): New.
1423 (cp_build_function_call): Add tsubst_flags_t parameter.
1424 (build_x_unary_op): Ditto.
1425 (cp_build_unary_op): New.
1426 (build_x_conditional_expr): Add tsubst_flags_t parameter.
1427 (build_x_compound_expr): Ditto.
1428 (build_compound_expr): Ditto.
1429 (build_static_cast): Ditto.
1430 (build_reinterpret_cast): Ditto.
1431 (build_const_cast): Ditto.
1432 (build_c_cast): Ditto.
1433 (build_x_modify_expr): Ditto.
1434 (cp_build_modify_expr): New.
1435 (convert_for_initialization): Add tsubst_flags_t parameter.
1436 (cp_build_binary_op): Remove macro; add function declaration.
1437 (invalid_nonstatic_memfn_p): Add tsubst_flags_t parameter.
1438 (lvalue_or_else): Ditto.
1439 (build_functional_cast): Ditto.
1440 * typeck2.c (digest_init): Fix calls for SFINAE.
1441 (process_init_constructor_array): Ditto.
1442 (process_init_constructor_record): Ditto.
1443 (build_x_arrow): Ditto.
1444 (build_m_component_ref): Ditto.
1445 (build_functional_cast): Add SFINAE support.
1446 * pt.c (tsubst_copy_and_build): Add (more) SFINAE support.
1447 * semantics.c (simplify_loop_decl_cond): Fix calls for SFINAE.
1448 (finish_expr_stmt): Ditto.
1449 (finish_for_expr): Ditto.
1450 (finish_asm_stmt): Ditto.
1451 (finish_non_static_data_member): Ditto.
1452 (finish_qualified_id_expr): Ditto.
1453 (finish_call_expr): Add SFINAE support.
1454 (finish_increment_expr): Fix calls for SFINAE.
1455 (finish_unary_op_expr): Ditto.
1456 (simplify_aggr_init_expr): Ditto.
1457 (finish_omp_clauses): Ditto.
1458 (finish_omp_for): Ditto.
1459 (finish_omp_barrier): Ditto.
1460 (finish_omo_flush): Ditto.
1461 * decl2.c (grok_array_decl): Fix calls or SFINAE.
1462 (build_anon_union_vars): Ditto.
1463 (get_guard_cond): Ditto.
1465 (one_static_initialization_or_destruction): Ditto.
1466 (do_static_initialization_or_destruction): Ditto.
1467 (generate_ctor_or_dtor_function): Ditto.
1468 (build_offset_ref_call_from_tree): Ditto.
1469 * parser.c (cp_parser_postfix_expression): Fix calls for SFINAE.
1470 (cp_parser_postfix_dot_deref_expression): Ditto.
1471 (cp_parser_unary_expression): Ditto.
1472 (cp_parser_new_expression): Ditto.
1473 (cp_parser_cast_expression): Ditto.
1474 (cp_parser_binary_expression): Ditto.
1475 (cp_parser_question_colon_clause): Ditto.
1476 (cp_parser_assignment_expression): Ditto.
1477 (cp_parser_expression): Ditto.
1478 (cp_parser_builtin_offsetof): Ditto.
1479 (cp_parser_template_argument): Ditto.
1480 (cp_parser_functional_cast): Ditto.
1482 2008-03-24 Tom Tromey <tromey@redhat.com>
1484 * lex.c (handle_pragma_interface): Don't copy the filename.
1485 (handle_pragma_implementation): Copy filename using xstrdup.
1487 2008-03-21 Paolo Carlini <pcarlini@suse.de>
1489 * cp-tree.h (IS_AGGR_TYPE): Rename to MAYBE_CLASS_TYPE_P.
1490 (SET_IS_AGGR_TYPE): Rename to SET_CLASS_TYPE_P.
1491 (IS_AGGR_TYPE_CODE): Rename to RECORD_OR_UNION_CODE_P.
1492 (PROMOTES_TO_AGGR_TYPE): Remove.
1493 (CLASS_TYPE_P, TYPE_NON_AGGREGATE_CLASS): Adjust.
1494 * typeck.c (unary_complex_lvalue, build_modify_expr,
1495 convert_for_initialization): Adjust.
1496 * init.c (is_aggr_type): Remove.
1497 (is_class_type): Add.
1498 (build_offset_ref, build_new_1, build_vec_delete_1, build_vec_init,
1499 build_delete): Adjust.
1500 * lex.c (make_aggr_type): Remove.
1501 (make_class_type): Add.
1502 (cxx_make_type): Adjust.
1503 * class.c (finish_struct_1, fixed_type_or_null, is_empty_class):
1505 * decl.c (build_typename_type, make_typename_type,
1506 make_unbound_class_template, cxx_init_decl_processing,
1507 check_tag_decl, groktypename, start_decl_1, layout_var_decl,
1508 check_initializer, cp_finish_decl, build_ptrmemfunc_type, grokparms,
1509 grok_op_properties, xref_tag, check_function_type): Adjust.
1510 * call.c (check_dtor_name, standard_conversion, implicit_conversion,
1511 add_builtin_candidate, add_builtin_candidates,
1512 build_user_type_conversion_1, convert_like_real, build_cxx_call,
1513 is_subseq, compare_ics): Adjust.
1514 * method.c (use_thunk): Adjust.
1515 * rtti.c (build_dynamic_cast_1, create_pseudo_type_info,
1516 create_tinfo_types): Adjust.
1517 * cvt.c (cp_convert_to_pointer, convert_to_pointer_force,
1518 build_up_reference, convert_to_reference, convert_from_reference,
1519 ocp_convert, build_expr_type_conversion): Adjust.
1520 * tree.c (bind_template_template_parm, error_type): Adjust.
1521 * dump.c (cp_dump_tree): Adjust.
1522 * search.c (lookup_member): Adjust.
1523 * friend.c (make_friend_class, do_friend): Adjust.
1524 * typeck2.c (store_init_value, process_init_constructor_array,
1525 process_init_constructor_record, build_x_arrow, build_m_component_ref,
1526 build_functional_cast): Adjust.
1527 * pt.c (finish_member_template_decl, process_template_parm,
1528 lookup_template_class, tsubst_function_type, tsubst,
1529 tsubst_copy_and_build, get_template_base, bt_instantiate_type_proc):
1531 * semantics.c (begin_class_definition, finish_base_specifier,
1532 finish_typeof, cxx_omp_predetermined_sharing, finish_decltype_type):
1534 * name-lookup.c (constructor_name_p, push_overloaded_decl,
1535 do_class_using_decl, lookup_qualified_name,
1536 maybe_process_template_type_declaration): Adjust.
1537 * decl2.c (grok_array_decl, check_member_template,
1538 constrain_class_visibility): Adjust.
1539 * parser.c (cp_parser_class_name): Adjust.
1541 2008-03-18 Paolo Bonzini <bonzini@gnu.org>
1543 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Delete.
1545 2008-03-17 Jason Merrill <jason@redhat.com>
1548 * call.c (reference_binding): Check LOOKUP_NO_TEMP_BIND when binding
1549 a temp directly to a reference as per DR391.
1551 2008-03-12 Richard Guenther <rguenther@suse.de>
1555 2008-02-04 Richard Guenther <rguenther@suse.de>
1558 * decl.c (record_builtin_java_type): Make jboolean a
1559 integer type again where its mode doesn't match that of bool.
1561 2008-01-25 Richard Guenther <rguenther@suse.de>
1564 * decl.c (record_builtin_java_type): Make __java_boolean
1566 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
1567 after TYPE_MAIN_VARIANT check.
1569 2008-03-10 Jakub Jelinek <jakub@redhat.com>
1572 * semantics.c (finish_omp_clauses): Look through NOP_EXPR even
1576 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
1577 DECL_P in not a variable and appears more than once error messages.
1579 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
1583 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
1587 * typeck.c (structural_comptypes): Call cp_comptypes.
1588 (comptypes): New; called from the C/C++ common bits to perform
1590 (cp_comptypes): Renamed from comptypes, which is already used,
1591 with a different signature, by the C++ front end.
1592 (build_reinterpret_cast_1): Call cp_comptypes.
1593 (ptr_reasonably_similar): Ditto.
1594 * decl.c (decls_match): Ditto.
1595 * cvt.c (convert_to_reference): Ditto.
1596 * cp-tree.h (same_type_p): Ditto.
1597 (same_or_base_type_p): Ditto.
1598 (comptypes): Rename to cp_comptypes.
1599 * pt.c (canonical_type_parameter): Call cp_comptypes.
1601 2008-03-07 Paolo Bonzini <bonzini@gnu.org>
1603 * cp-objcp-common.c (cxx_types_compatible_p): Remove obsolete
1604 test for equivalence between pointer and references.
1606 2008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1609 * class.c (finish_struct_anon): Use permerror instead of pedwarn.
1610 (check_field_decls): Likewise.
1611 (note_name_declared_in_class): Likewise.
1612 * call.c (build_new_op): Likewise.
1613 (convert_like_real): Likewise.
1614 (build_over_call): Likewise.
1615 * lex.c (unqualified_fn_lookup_error): Likewise.
1616 * parser.c (cp_parser_template_id): Likewise.
1617 * cvt.c (warn_ref_binding): Likewise.
1618 (convert_to_reference): Likewise.
1619 (ocp_convert): Likewise.
1620 (convert_to_void): Use error instead of pedwarn.
1621 * error.c (cp_cpp_error): Use pedantic_warning_kind.
1622 * decl.c (compute_array_index_type): Use constant_expression_error.
1624 2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
1626 * parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
1627 that auto is either a storage class or a simple type specifier,
1628 depending on the dialect.
1629 (cp_parser_decl_specifier_seq): Complain about `auto' as a storage
1630 specifier in C++98 mode, error in C++0x mode (since we don't
1631 support auto as a type specifier, yet).
1632 (cp_parser_storage_class_specifier_opt): Don't treat `auto' as a
1633 storage specifier in C++0x mode.
1634 (cp_parser_simple_type_specifier): Parse `auto' as a
1635 simple-type-specifier, but error because we don't support it yet.
1637 2008-02-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1639 * parser.c (cp_parser_nonclass_name): New.
1640 (cp_parser_pseudo_destructor_name): Use it instead of
1641 cp_parser_type_name.
1642 (cp_parser_type_name): Move code to cp_parser_nonclass_name.
1644 2008-02-29 Tom Tromey <tromey@redhat.com>
1646 * parser.c (struct cp_token) <input_file_stack_index>: Remove.
1647 (cp_lexer_get_preprocessor_token): Update.
1648 (cp_lexer_set_source_position_from_token): Don't call
1649 restore_input_file_stack.
1650 * lex.c (cxx_init): Don't use push_srcloc or pop_srcloc.
1652 2008-02-28 Richard Guenther <rguenther@suse.de>
1655 2008-02-26 Richard Guenther <rguenther@suse.de>
1657 * decl.c (duplicate_decls): Remove decl from global mapping
1658 before ggc_freeing it.
1660 2008-02-27 Jakub Jelinek <jakub@redhat.com>
1663 * rtti.c: Include c-pragma.h.
1664 (push_abi_namespace, pop_abi_namespace): New functions.
1665 (build_dynamic_cast_1, tinfo_base_init, get_pseudo_ti_index,
1666 create_tinfo_types, emit_support_tinfos): Use them.
1667 * Make-lang.in (cp/rtti.o): Depend on $(C_PRAGMA_H).
1669 2008-02-26 Jason Merrill <jason@redhat.com>
1672 * decl.c (grokdeclarator): Allow a typedef of an unnamed struct
1673 to name the struct for linkage purposes even if it has attributes.
1674 (start_decl): In that case, set ATTR_FLAG_TYPE_IN_PLACE.
1676 2008-02-26 Tom Tromey <tromey@redhat.com>
1678 * parser.c (eof_token): Remove old location code.
1679 (check_empty_body): Remove test of USE_MAPPED_LOCATION.
1680 * decl2.c (generate_ctor_or_dtor_function): Remove old location
1682 (cp_write_global_declarations): Likewise.
1683 * lex.c (cxx_init): Remove old location code.
1684 (handle_pragma_implementation): Remove test of
1685 USE_MAPPED_LOCATION.
1686 * pt.c (tsubst): Remove old location code.
1687 * error.c (cp_print_error_function): Remove test of
1688 USE_MAPPED_LOCATION.
1689 * decl.c (pop_label): Remove old location code.
1690 (finish_function): Likewise.
1692 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1695 * call.c (magic_varargs_p): Remove BUILT_IN_STDARG_START.
1697 2008-02-26 Richard Guenther <rguenther@suse.de>
1699 * decl.c (duplicate_decls): Remove decl from global mapping
1700 before ggc_freeing it.
1702 2008-02-26 Paolo Carlini <pcarlini@suse.de>
1705 * name-lookup.c (arg_assoc_type): Handle FIXED_POINT_TYPE.
1707 2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1709 * typeck.c (build_class_member_access_expr): Add appropriate
1710 OPT_W* parameter to warning.
1711 (build_reinterpret_cast_1): Likewise.
1712 * name-lookup.c (push_overloaded_decl): Likewise.
1714 2008-02-25 Paolo Carlini <pcarlini@suse.de>
1717 * error.c (dump_expr): Handle CONJ_EXPR.
1719 2008-02-25 Paolo Carlini <pcarlini@suse.de>
1722 * error.c (dump_type): Handle FIXED_POINT_TYPE.
1723 (dump_expr): Handle FIXED_CST.
1725 2008-02-24 Jason Merrill <jason@redhat.com>
1727 * parser.c (cp_parser_declaration): Handle "inline namespace".
1728 (cp_parser_namespace_definition): Likewise.
1731 * name-lookup.c (arg_assoc_namespace): Look down into inline
1734 2008-02-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1736 * typeck.c (check_for_casting_away_constness): Use 1 single
1737 argument, the type of cast, to decide what diagnostics generate.
1738 (build_static_cast_1): Remove unused code. Update call to
1739 check_for_casting_away_constness.
1740 (build_reinterpret_cast_1): Update call to
1741 check_for_casting_away_constness.
1742 (build_const_cast_1): Likewise.
1744 2008-02-24 Paolo Carlini <pcarlini@suse.de>
1746 * error.c (dump_expr): Don't deal directly with NEW_EXPR (and
1747 VEC_NEW_EXPR), forward to pp_expression.
1748 * cxx-pretty-print.c (pp_cxx_new_expression): Fix FIXME.
1750 2008-02-24 Danny Smith <dannysmith@users.sourceforge.net>
1753 * friend.c (do_friend): Call cplus_decl_attributes earlier.
1755 2008-02-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
1758 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS for
1759 template decls' function decl.
1761 2008-02-22 Paolo Carlini <pcarlini@suse.de>
1765 2008-02-14 Paolo Carlini <pcarlini@suse.de>
1768 * pt.c (determine_specialization): In case of function templates,
1769 when the type of DECL does not match FN there is no match.
1771 2008-02-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1774 * typeck.c (build_binary_op): Warn about floating point
1775 comparisons if FLOAT_TYPE_P, not only for REAL_TYPE.
1777 2008-02-19 Jason Merrill <jason@redhat.com>
1780 * pt.c (resolve_overloaded_unification): Set processing_template_decl
1781 while we look for possible bindings.
1783 2008-02-19 Jakub Jelinek <jakub@redhat.com>
1786 * cp-gimplify.c (cxx_omp_clause_apply_fn): Handle vararg copy ctors.
1790 * semantics.c (finish_omp_threadprivate): Do nothing for error_operand_p
1791 vars. Afterwards ensure v is VAR_DECL.
1794 * parser.c (cp_parser_omp_for_loop): If DECL has REFERENCE_TYPE, don't
1795 call cp_finish_decl.
1796 * semantics.c (finish_omp_for): Fail if DECL doesn't have integral type
1799 2008-02-15 Douglas Gregor <doug.gregor@gmail.com>
1804 * pt.c (finish_member_template_decl): If the type in a TYPE_DECL
1805 is error_mark_node, return an error early.
1806 (find_parameter_packs_r): Pass the pointer set along to recursive
1807 calls of cp_walk_subtrees; don't try to manage the pointer set
1809 (uses_parameter_packs): Pass the pointer set to cp_walk_tree.
1810 (make_pack_expansion): Ditto.
1811 (check_for_bare_parameter_packs): Ditto. Also, don't bother taking
1812 a second pass through the tree with find_parameter_packs_r; that
1813 second pass no longer does anything.
1814 (push_template_decl_real): If we have an erroneous declaration,
1815 set its type to error_mark_node before returning an error.
1817 2008-02-14 Douglas Gregor <doug.gregor@gmail.com>
1820 * pt.c (tsubst_initializer_list): Deal with the use of
1821 VOID_TYPE_NODE to indicate value-initialization of the bases.
1823 2008-02-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1824 Jason Merrill <jason@redhat.com>
1828 * class.c (type_has_user_nondefault_constructor): New fn.
1829 * cp-tree.h: Declare it.
1830 * init.c (emit_mem_initializers): Use it for -W warning about
1831 missing base initializer.
1833 2008-02-14 Paolo Carlini <pcarlini@suse.de>
1836 * pt.c (determine_specialization): In case of function templates,
1837 when the type of DECL does not match FN there is no match.
1839 2008-02-13 Jakub Jelinek <jakub@redhat.com>
1840 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1843 * parser.c (cp_parser_pseudo_destructor_name): If next tokens
1844 are not identifier :: ~, return before calling cp_parser_type_name.
1846 2008-02-13 Jason Merrill <jason@redhat.com>
1848 PR c++/34962, c++/34937, c++/34939
1849 * decl2.c (is_late_template_attribute): Always defer attributes
1850 vector_size and weak.
1853 * pt.c (value_dependent_expression_p): Look into DECL_INITIAL
1854 of enumerators, too.
1856 2008-02-12 Jason Merrill <jason@redhat.com>
1859 * call.c (convert_like_real): Pass LOOKUP_NO_CONVERSION to build_temp
1860 if we're doing conversions to call a user-defined conversion function.
1862 2008-02-12 Steven Bosscher <steven@gcc.gnu.org>
1865 * semantics.c (finish_qualified_id_expr): Avoid duplicate access
1868 2008-02-12 Jakub Jelinek <jakub@redhat.com>
1871 * init.c (build_new_1): Don't create placement_expr before
1872 constructing alloc_call. Verify that the pointer is passed by
1873 value to operator new.
1875 2008-02-11 Jason Merrill <jason@redhat.com>
1878 * pt.c (tsubst): Don't look up a template typedef in an explicit
1881 2008-02-11 Douglas Gregor <doug.gregor@gmail.com>
1884 * tree.c (cp_build_qualified_type_real): When building a
1885 cv-qualified array type, build it as a unique type with
1886 build_cplus_array_type_1 and then adopt the unqualified type's
1889 2008-02-11 Paolo Carlini <pcarlini@suse.de>
1892 * decl.c (groktypename): Check grokdeclarator return.
1894 2008-02-10 Jason Merrill <jason@redhat.com>
1897 * decl2.c (cp_write_global_declarations): Don't write out static
1898 data members with DECL_IN_AGGR_P set.
1900 2008-02-08 Jason Merrill <jason@redhat.com>
1903 * tree.c (build_target_expr_with_type): Handle void initializer.
1904 (bot_manip): Remap slot before recursing.
1906 2008-02-06 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1909 * Make-lang.in (cc1plus-dummy, cc1plus): Add $(GMPLIBS).
1911 2008-02-06 Alexandre Oliva <aoliva@redhat.com>
1914 * tree.c: Include tree-flow.h.
1915 (build_target_expr): Check type compatibility.
1916 * Make-lang.in (cp/tree.o): Depend on $(TREE_FLOW_H).
1917 * call.c (convert_like_real): Convert bitfield to expected type.
1919 2008-02-06 Douglas Gregor <doug.gregor@gmail.com>
1923 * typeck.c (structural_comptypes): Call cp_comptypes.
1924 (comptypes): New; called from the C/C++ common bits to perform
1926 (cp_comptypes): Renamed from comptypes, which is already used,
1927 with a different signature, by the C++ front end.
1928 (build_reinterpret_cast_1): Call cp_comptypes.
1929 (ptr_reasonably_similar): Ditto.
1930 * decl.c (decls_match): Ditto.
1931 * cvt.c (convert_to_reference): Ditto.
1932 * cp-tree.h (same_type_p): Ditto.
1933 (same_or_base_type_p): Ditto.
1934 (comptypes): Rename to cp_comptypes.
1935 * pt.c (canonical_type_parameter): Call cp_comptypes.
1937 2008-02-05 Jakub Jelinek <jakub@redhat.com>
1940 * pt.c (tsubst) <case INTEGER_TYPE>: Don't issue error if max is
1941 value dependent expression.
1943 2008-02-05 Douglas Gregor <doug.gregor@gmail.com>
1946 * decl2.c (save_template_attributes): When we're modifying the
1947 TYPE_MAIN_VARIANT to add new attributes, be sure to also modify
1948 all of the other variants to add those same attributes. Otherwise,
1949 the main variant will be inconsistent with those other variants.
1951 2008-02-04 Richard Guenther <rguenther@suse.de>
1954 * decl.c (record_builtin_java_type): Make jboolean a
1955 integer type again where its mode doesn't match that of bool.
1957 2008-02-02 Jason Merrill <jason@redhat.com>
1958 Mark Mitchell <mark@codesourcery.com>
1961 * init.c (build_value_init_1): New function.
1962 (build_value_init): New function.
1963 * typeck2.c (build_functional_cast): Call it.
1964 * cp-gimplify.c (cp_gimplify_init_expr): Handle its output.
1966 * cp-tree.h (TYPE_HAS_USER_CONSTRUCTOR): Rename from
1967 TYPE_HAS_CONSTRUCTOR.
1968 * class.c (finish_struct_bits, maybe_warn_about_overly_private_class,
1969 add_implicitly_declared_members): Adjust.
1970 (check_field_decls): Adjust. Remove warnings about reference/const
1971 in class without constructor.
1972 (check_bases_and_members): Adjust. Give those warnings here instead.
1973 * decl.c (fixup_anonymous_aggr): Adjust.
1974 (check_initializer): Adjust, clarify logic slightly.
1975 (grok_special_member_properties): Adjust, only set if user-provided.
1976 * rtti.c (create_tinfo_types): Don't set.
1977 * cvt.c (ocp_convert): Remove exception for vtable_entry_type et al.
1978 Use same_type_ignoring_top_level_qualifiers_p.
1979 * pt.c (check_explicit_specialization): Adjust.
1980 (instantiate_class_template): Adjust.
1982 2008-01-31 Douglas Gregor <doug.gregor@gmail.com>
1983 Jakub Jelinek <jakub@redhat.com>
1987 * typeck.c (structural_comptypes): Handle comparisons of
1988 VOID_TYPE, BOOLEAN_TYPE, INTEGER_TYPE, FIXED_POINT_TYPE, and
1990 * mangle.c (write_builtin_type): Map down to the canonical type,
1991 which will be one of the predefined type nodes.
1993 2008-01-29 Michael Meissner <michael.meissner@amd.com>
1996 * cp-tree.h (struct full_lang_decl): Make tree_code bitfield 16
1997 bits to allow for expansion of the number of middle end tree
2000 2008-01-29 Douglas Gregor <doug.gregor@gmail.com>
2011 * typeck.c (check_return_expr): Tweak call to
2012 check_for_bare_parameter_packs.
2013 * class.c (add_method): Be careful with error_mark_nodes.
2014 * cp-tree.h (check_for_bare_parameter_packs): Remove "*" from
2016 * pt.c (struct find_parameter_pack_data): Remove
2018 (find_parameter_packs_r): Don't use SET_PACKS_TO_ERROR.
2019 (uses_parameter_packs): Don't set SET_PACKS_TO_ERROR.
2020 (make_pack_expansion): Ditto.
2021 (check_for_bare_parameter_packs): Parameter is now a tree, not a
2023 (process_template_parm): Tweak call to
2024 check_for_bare_parameter_packs.
2025 (push_template_decl_real): Tweak calls to
2026 check_for_bare_parameter_packs. If bare parameter packs are found
2027 in the list of exceptions, clear out that list after giving an
2029 * semantics.c (finish_cond): Tweak call to
2030 check_for_bare_parameter_packs.
2031 (finish_expr_stmt): Ditto.
2032 (finish_for_expr): Ditto.
2033 (finish_switch_cond): Ditto.
2034 (finish_mem_initializers): Ditto.
2035 (finish_member_declaration): Ditto.
2036 (finish_static_assert): Check for bare parameter packs in the
2038 * decl2.c (cplus_decl_attributes): Check for bare parameter packs in the
2039 attributes of a declaration.
2040 * parser.c (cp_parser_using_declaration): Tweak call to
2041 check_for_bare_parameter_packs.
2042 (cp_parser_base_clause): Ditto.
2044 2008-01-28 Jason Merrill <jason@redhat.com>
2047 * class.c (build_base_path): Fix !want_pointer case.
2049 2008-01-27 Jason Merrill <jason@redhat.com>
2052 * class.c (build_base_path): Fix previous change.
2054 2008-01-26 Jakub Jelinek <jakub@redhat.com>
2057 * error.c (dump_expr): Handle TRUTH_AND_EXPR, TRUTH_OR_EXPR
2060 2008-01-26 Richard Guenther <rguenther@suse.de>
2063 * typeck.c (build_binary_op): Remove code to shorten compares.
2065 2008-01-25 Richard Guenther <rguenther@suse.de>
2068 * decl.c (record_builtin_java_type): Make __java_boolean
2070 * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
2071 after TYPE_MAIN_VARIANT check.
2073 2008-01-25 Jason Merrill <jason@redhat.com>
2076 * class.c (build_base_path): Don't mess with virtual access if
2078 * call.c (standard_conversion): Don't check whether source type
2081 * decl2.c (is_late_template_attribute): Don't defer attribute
2082 visibility just because the type is dependent.
2084 2008-01-25 Jason Merrill <jason@redhat.com>
2085 Mark Mitchell <mark@codesourcery.com>
2088 * call.c (standard_conversion): Allow conversion from integer/real
2090 (compare_ics): Such a conversion is worse than a normal arithmetic
2093 2008-01-25 Richard Guenther <rguenther@suse.de>
2096 * cp-lang.c (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define
2099 2008-01-24 Paolo Carlini <pcarlini@suse.de>
2102 * pt.c (push_template_decl_real): Return error_mark_node in case
2103 of template definition of non-template.
2105 2008-01-24 Jason Merrill <jason@redhat.com>
2108 * decl2.c (is_late_template_attribute): Defer any attribute with
2109 dependent args. Also defer type attributes if the type is dependent.
2111 2008-01-22 Jakub Jelinek <jakub@redhat.com>
2112 Alexandre Oliva <aoliva@redhat.com>
2115 * call.c (reference_binding): For bitfields use the declared bitfield
2117 (add_builtin_candidates): Likewise.
2118 * class.c (layout_class_type): For bitfields copy over the
2119 original type quals.
2121 2008-01-22 Jason Merrill <jason@redhat.com>
2124 * decl.c (groktypename): Also ignore attributes on dependent
2125 possibly-class types.
2128 * friend.c (do_friend): Check for prior declaration of a friend
2129 function of a local class.
2130 * name-lookup.c (lookup_name_innermost_nonclass_level):
2132 * name-lookup.h: Declare it.
2134 2008-01-22 Tom Tromey <tromey@redhat.com>
2137 * init.c (build_new_1): Only disallow Java aggregates.
2139 2008-01-22 Jakub Jelinek <jakub@redhat.com>
2142 * semantics.c (finish_omp_for): Don't call c_finish_omp_for
2143 if decl or init is error_mark_node.
2146 * error.c (dump_expr): Handle VECTOR_CST.
2148 2008-01-21 Jason Merrill <jason@redhat.com>
2151 * pt.c (tsubst_aggr_type): Make sure our context is complete.
2154 * pt.c (retrieve_local_specialization): Robustify.
2155 (tsubst_pack_expansion, tsubst_decl): Remove redundant checks.
2158 * pt.c (tsubst): Only call retrieve_local_specialization if the
2159 original typedef was in a function template.
2162 * decl.c (wrap_cleanups_r): Set TRY_CATCH_IS_CLEANUP.
2164 2008-01-21 Richard Guenther <rguenther@suse.de>
2167 * error.c (cp_print_error_function): Deal with recursive
2170 2008-01-20 Paolo Carlini <pcarlini@suse.de>
2173 * error.c (dump_expr): Deal with VIEW_CONVERT_EXPR.
2175 2008-01-20 Paolo Carlini <pcarlini@suse.de>
2179 * name-lookup.c (do_class_using_decl): Do not call constructor_name_p
2180 on non-IS_AGGR_TYPE scope.
2181 (constructor_name_p): Assert IS_AGGR_TYPE.
2183 2008-01-18 Ian Lance Taylor <iant@google.com>
2186 * decl.c (duplicate_decls): Copy DECL_IS_OPERATOR_NEW flag.
2187 (grok_op_properties): For NEW_EXPR and VEC_NEW_EXPR set
2188 DECL_IS_OPERATOR_NEW flag.
2190 2008-01-16 Richard Guenther <rguenther@suse.de>
2193 * typeck.c (is_bitfield_expr_with_lowered_type): Recurse
2194 for conversions to type variants.
2196 2008-01-15 Andreas Tobler <a.tobler@schweiz.org>
2198 * parser.c (cp_parser_template_parameter): Fix C90 issue with mixing
2199 declaration and code. Update copyright year.
2201 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2204 * friend.c (do_friend): Don't query TYPE_BEING_DEFINED unless we
2205 know we have a class type.
2207 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2210 * pt.c (coerce_template_parameter_pack): When substituting into
2211 the type of a non-type template parameter pack. use the
2212 deduced/substituted arguments.
2213 * parser.c (declarator_can_be_parameter_pack): A pointer-to-member
2214 can be a parameter pack with the ellipsis following it. When we
2215 have an erroneous declaration, allow it to be a parameter pack.
2216 (cp_parser_template_parameter): Complain about default
2217 arguments on non-type template parameter packs, and parse them
2218 using the new cp_parser_default_argument.
2219 (cp_parser_parameter_declaration): Complain about parameter packs
2220 with default arguments. Move parsing of default arguments into a
2221 new function, cp_parser_default_argument.
2222 (cp_parser_default_argument): New; extracted from
2223 cp_parser_parameter_declaration.
2225 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2231 * typeck.c (check_return_expr): If there are bare parameter packs
2232 in the return value, set it to error_mark_node.
2233 * tree.c (cp_walk_subtrees): Walk USING_DECL nodes.
2234 * pt.c (find_parameter_packs_r): Look at the type of
2235 IDENTIFIER_NODEs (e.g., for user-defined conversions).
2236 (check_for_bare_parameter_packs): Flip the result: now returns
2237 TRUE when there were bare parameter packs, FALSE otherwise.
2238 (push_template_decl_real): Deal with flipped result of
2239 check_for_bare_parameter_packs.
2240 * semantics.c (finish_cond): If there are bare parameter packs in
2241 the conditional, set it to error_mark_node.
2242 (finish_expr_stmt): If there are bare parameter packs in the
2243 expression, set it to error_mark_node.
2244 (finish_for_expr): Ditto.
2245 (finish_switch_cond): If there are bare parameter packs in
2246 the conditional, set it to error_mark_node.
2247 (finish_mem_initializers): If there are bare parameter packs in
2248 the member initializer, set it to error_mark_node.
2249 (finish_member_declaration): Check the attributes of the
2250 declaration for bare parameter packs, and remove the attributes if
2251 any have bare parameter packs.
2252 * parser.c (cp_parser_using_declaration): Check the using
2253 declaration for bare parameter packs.
2254 (cp_parser_base_clause): If there are bare parameter packs in a
2255 base specifier, don't add it to the chain.
2257 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2260 * error.c (dump_simple_decl): Display ellipsis for template
2261 non-type parameter packs.
2262 (dump_decl): Display ellipsis for template type parameter packs.
2263 (dump_template_decl): Display ellipsis for template template
2265 * pt.c (redeclare_class_template): When redeclaring a class
2266 template, check for collisions between template parameters and
2267 template parameter packs.
2269 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2272 * pt.c (process_partial_specialization): Don't mark template
2273 parameters that occur in non-deduced contexts.
2274 (struct pair_fn_data): Add include_nondeduced_p.
2275 (for_each_template_parm_r): Only visit non-deduced contexts if
2276 include_nondeduced_p is set.
2277 (for_each_template_parm): Added parameter include_nondeduced_p,
2278 which states whether template parameters found in non-deduced
2279 contexts should be visited.
2280 (uses_template_parms): Visit all template parameters, even those
2281 in non-deduced contexts.
2283 2008-01-15 Douglas Gregor <doug.gregor@gmail.com>
2286 * pt.c (check_default_tmpl_args): Check for parameter packs that
2287 aren't at the end of a primary template.
2288 (push_template_decl_real): Remove check for parameter packs that
2289 aren't at the end of a primary template; that now happens in
2290 check_default_tmpl_args.
2291 * semantics.c (finish_template_template_parm): Use
2292 check_default_tmpl_args to check for errors in the template
2295 2008-01-12 Doug Kwan <dougkwan@google.com>
2297 * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers
2298 instead of OPT_Wreturn_type in warning due to ignored return type
2300 * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers
2301 instead of OPT_Wreturn_type in warning due to ignored return type
2304 2008-01-08 Jakub Jelinek <jakub@redhat.com>
2307 * semantics.c (finish_omp_for): Don't call
2308 fold_build_cleanup_point_expr if processing_template_decl.
2310 2008-01-04 Paolo Carlini <pcarlini@suse.de>
2311 Jakub Jelinek <jakub@redhat.com>
2314 * error.c (dump_template_argument): Deal with TREE_LIST.
2316 2008-01-01 Douglas Gregor <doug.gregor@gmail.com>
2318 * parser.c (cp_parser_check_decl_spec): Don't warn about "long
2319 long" in C++0x mode; change the warning to note that "long long"
2320 is only unsupported in C++98 mode.
2322 2007-12-20 Jason Merrill <jason@redhat.com>
2325 * call.c (standard_conversion): Derived-to-base is considered a
2326 standard conversion.
2328 2007-12-19 Jakub Jelinek <jakub@redhat.com>
2331 * parser.c (cp_parser_omp_parallel): For non-combined parallel
2332 call cp_parser_statement rather than
2333 cp_parser_already_scoped_statement.
2335 2007-12-18 Jason Merrill <jason@redhat.com>
2338 * pt.c (tsubst_aggr_type): Do nothing if the type already doesn't
2340 (dependent_type_p_r): Handle the domain of an array.
2342 2007-12-18 Douglas Gregor <doug.gregor@gmail.com>
2343 Jakub Jelinek <jakub@redhat.com>
2348 * pt.c (template_template_parm_bindings_ok_p): New; verifies
2349 bindings of template template parameters after all template
2350 arguments have been deduced.
2351 (coerce_template_parms): Don't complain when COMPLAIN doesn't
2353 (fn_type_unification): Use template_template_parm_bindings_ok_p.
2354 (unify): Deal with variadic, bound template template parameters.
2355 (get_class_bindings): Use template_template_parm_bindings_ok_p.
2357 2007-12-18 Jakub Jelinek <jakub@redhat.com>
2360 * decl.c (grokdeclarator): Reject friend sfk_constructor
2363 2007-12-17 Jakub Jelinek <jakub@redhat.com>
2366 * parser.c (cp_parser_omp_all_clauses): Accept optional comma
2369 2007-12-15 Alexandre Oliva <aoliva@redhat.com>
2372 * cp-lang.c (cp_classify_record): New.
2373 (LANG_HOOKS_CLASSIFY_RECORD): Override.
2375 2007-12-11 Jakub Jelinek <jakub@redhat.com>
2378 * decl2.c (cp_write_global_declarations): Revert 2007-11-22 change.
2381 * rtti.c (build_dynamic_cast): Call convert_from_reference even for
2382 dynamic_cast in a template.
2384 2007-12-10 Simon Martin <simartin@users.sourceforge.net>
2387 * typeck.c (build_class_member_access_expr): Compute MEMBER_SCOPE from
2388 MEMBER's BASELINK_ACCESS_BINFO instead of its BASELINK_BINFO.
2390 2007-12-10 Jakub Jelinek <jakub@redhat.com>
2393 * error.c (dump_type_prefix, dump_type_suffix): Handle
2394 TYPE_PACK_EXPANSION.
2397 * error.c (dump_expr): Handle ABS_EXPR.
2399 2007-12-09 Jakub Jelinek <jakub@redhat.com>
2403 * repo.c (repo_emit_p): Return 2 for DECL_INTEGRAL_CONSTANT_VAR_P
2404 in class scope rather than DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.
2405 Return 2 also if DECL_EXPLICIT_INSTANTIATION.
2406 * decl2.c (import_export_decl): Don't make VAR_DECLs import_p when
2407 flag_use_repository and repo_emit_p returned 2.
2409 2007-12-06 Jakub Jelinek <jakub@redhat.com>
2412 * tree.c (stabilize_call, stabilize_init): Do nothing if
2413 processing_template_decl.
2415 2007-12-05 Jakub Jelinek <jakub@redhat.com>
2418 * semantics.c (finish_decltype_type): For SCOPE_REF issue an
2419 error instead of assertion failure.
2420 * parser.c (cp_parser_decltype): If closing paren is not found,
2421 return error_mark_node.
2423 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
2426 * name-lookup.c (arg_assoc_template_arg): Recurse on argument
2428 (arg_assoc_type): We don't need to handle TYPE_ARGUMENT_PACK here,
2429 since arg_assoc_template_arg will deal with them (better).
2431 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
2434 * pt.c (tsubst_exception_specification): Handle substitutions into
2435 member templates, where tsubst_pack_expansion returns a
2436 TYPE_PACK_EXPANSION.
2438 2007-12-04 Douglas Gregor <doug.gregor@gmail.com>
2441 * pt.c (unify_pack_expansion): If we didn't deduce any actual
2442 bindings for the template parameter pack, don't try to keep the
2443 empty deduced arguments.
2444 (unify): If a parameter is a template-id whose template argument
2445 list contains a pack expansion that is not at the end, then we
2446 cannot unify against that template-id.
2448 2007-12-02 Paolo Carlini <pcarlini@suse.de>
2451 * pt.c (current_template_args): Use error_operand_p.
2453 2007-12-02 Paolo Carlini <pcarlini@suse.de>
2456 * error.c (dump_decl): Handle TREE_BINFO.
2458 2007-12-01 Ollie Wild <aaw@google.com>
2461 * typeck.c (build_binary_op): Add conversion of pointers to function
2462 members appearing as operands to the equality operators.
2464 2007-11-30 Jakub Jelinek <jakub@redhat.com>
2467 * error.c (dump_expr): Handle OBJ_TYPE_REF.
2469 2007-11-29 Jakub Jelinek <jakub@redhat.com>
2472 * tree.c (lvalue_p_1) <case COND_EXPR>: Handle x ?: y
2474 * typeck.c (is_bitfield_expr_with_lowered_type) <case COND_EXPR>:
2479 * parser.c (cp_parser_decltype): Don't call finish_id_expression
2481 * semantics.c (finish_decltype_type): Issue error on types, TYPE_DECLs
2484 2007-11-27 Jakub Jelinek <jakub@redhat.com>
2486 PR tree-optimization/34181
2487 * method.c (use_thunk): Don't inline the call in the thunk.
2490 * tree.c (decl_linkage): Static data members and static member
2491 functions in anonymous ns classes are lk_external.
2493 2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
2496 * decl.c (start_preparsed_function): Pass
2497 processing_template_decl for the new allocate_struct_function
2500 2007-11-25 Richard Guenther <rguenther@suse.de>
2502 * decl.c (poplevel): Use BLOCK_CHAIN.
2504 2007-11-24 Ollie Wild <aaw@google.com>
2506 * typeck.c (delta_from_ptrmemfunc): New function.
2507 (get_member_function_from_ptrfunc): Call delta_from_ptrmemfunc.
2508 (build_binary_op): Call delta_from_ptrmemfunc.
2510 2007-11-23 Jakub Jelinek <jakub@redhat.com>
2514 * decl.c (cp_finish_decl): Disallow variable or field
2515 definitions if extern "Java" aggregates.
2516 (grokparms): Disallow parameters with extern "Java"
2518 (check_function_type): Disallow function return values
2519 with extern "Java" aggregates.
2520 * init.c (build_new_1): Disallow placement new with
2521 extern "Java" aggregates.
2523 2007-11-23 Mark Mitchell <mark@codesourcery.com>
2524 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2527 * call.c (convert_like_real): Build a zero constant when __null is
2528 converted to an integer type.
2530 2007-11-22 Jakub Jelinek <jakub@redhat.com>
2533 * decl2.c (cp_write_global_declarations): Issue error about static
2534 data members in anonymous namespace which are declared and used,
2537 2007-11-20 Jakub Jelinek <jakub@redhat.com>
2540 * parser.c (cp_parser_class_head): Reject function template ids.
2543 * tree.c (build_cplus_array_type_1): Don't pass any VLA types
2544 when processing_template_decl to build_array_type.
2547 * pt.c (more_specialized_fn): Don't segfault if one or
2548 both argument list end with ellipsis.
2550 2007-11-18 Jakub Jelinek <jakub@redhat.com>
2553 * semantics.c (finish_call_expr): Set
2554 current_function_returns_abnormally if fn is noreturn FUNCTION_DECL
2555 or OVERLOAD with all noreturn functions.
2557 2007-11-16 Jakub Jelinek <jakub@redhat.com>
2560 * pt.c (apply_late_template_attributes): Do nothing if decl's type is
2563 2007-11-13 Jakub Jelinek <jakub@redhat.com>
2570 * pt.c (find_parameter_packs_r): If ppd->set_packs_to_error,
2571 set to error_mark_node the outermost POINTER_TYPE to the pack if
2572 it is seen in a POINTER_TYPE.
2573 (push_template_decl_real): If check_for_bare_parameter_packs
2574 fails for function return type, set the return type to
2575 integer_type_node. If check_for_bare_parameter_packs failed
2576 for non-function, return error_mark_node.
2579 * call.c (build_new_op): Call resolve_args before calling
2582 2007-11-11 Tom Tromey <tromey@redhat.com>
2585 * lex.c (handle_pragma_implementation): Use cpp_included_before.
2587 2007-11-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2590 * pt.c (redeclare_class_template): Update error message. Use a
2591 note to show the previous declaration.
2592 (tsubst_friend_class): Use the location of the friend template as
2593 the input location before calling redeclare_class_template.
2595 2007-11-11 Jakub Jelinek <jakub@redhat.com>
2598 * semantics.c (finish_pseudo_destructor_expr): Handle
2599 object == error_mark_node.
2601 2007-11-10 Jakub Jelinek <jakub@redhat.com>
2604 * pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
2605 is not scalar type, let finish_class_member_access_expr handle
2606 diagnostics. Pass BIT_NOT_EXPR argument to
2607 finish_pseudo_destructor_expr. Handle SCOPE_REF properly.
2609 2007-11-09 Douglas Gregor <doug.gregor@gmail.com>
2612 * decl.c (cp_complete_array_type): If any of the initializer
2613 elements are pack expansions, don't compute the array size yet.
2615 2007-11-08 Andrew Pinski <pinskia@gmail.com>
2618 * tree.c (decl_linkage): Fields have no linkage.
2620 2007-11-08 Daniel Jacobowitz <dan@codesourcery.com>
2622 * class.c (build_ctor_vtbl_group): Lay out the new type and decl.
2624 2007-11-07 Douglas Gregor <doug.gregor@gmail.com>
2629 * semantics.c (finish_decltype_type): See through INDIRECT_REFs.
2630 Be careful with ERROR_MARK_NODEs.
2631 * parser.c (cp_parser_check_access_in_redeclaration): Handle NULL
2634 2007-11-07 Jakub Jelinek <jakub@redhat.com>
2637 * call.c (build_over_call): Don't check TREE_ADDRESSABLE
2640 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
2644 * tree.c (c_build_qualified_type): Define bridge to
2645 cp_build_qualified_type.
2647 2007-11-06 Douglas Gregor <doug.gregor@gmail.com>
2658 * typeck.c (check_return_expr): Pass address of retval to
2659 check_for_bare_parameter_packs.
2660 * class.c (build_base_field): Tolerate bases that have no layout
2662 (end_of_base): Ditto.
2663 * tree.c (canonical_type_variant): Be careful with
2665 * cp-tree.h (check_for_bare_parameter_packs): Now accepts a
2667 * pt.c (find_parameter_pack_data): Add set_packs_to_error field,
2668 which states whether parameter packs should be replaced with
2670 (find_parameter_packs_r): Pass addresses to cp_walk_tree wherever
2671 possible. If set_packs_to_error is set true, replace the parameter
2672 pack with ERROR_MARK_NODE. Manage our own pointer sets.
2673 (uses_parameter_packs): Don't set parameter packs to
2675 (check_for_bare_parameter_packs): Now takes a pointer to a tree,
2676 which may be modified (if it is a parameter pack). Instructs
2677 find_parameter_packs_r to replace parameter packs with
2678 ERROR_MARK_NODE (so that they won't cause errors later on).
2679 (process_template_parm): Pass pointer to
2680 check_for_bare_parameter_packs.
2681 (process_partial_specialization): Replace pack expansions before
2682 the end of the template argument list with ERROR_MARK_NODE.
2683 (push_template_decl_real): Pass pointer to
2684 check_for_bare_parameter_packs. Replace parameter packs not at the
2685 end of the template parameter list with ERROR_MARK_NODE.
2686 (convert_template_argument): Be more careful about using DECL_NAME
2687 on only declarations.
2688 (unify): Can't unify against ERROR_MARK_NODE.
2689 * semantics.c (finish_cond): Pass pointer to
2690 check_for_bare_parameter_packs.
2691 (finish_expr_stmt): Ditto.
2692 (finish_for_expr): Ditto.
2693 (finish_switch_cond): Pass pointer to
2694 check_for_bare_parameter_packs, and call it before we put the
2695 condition into the statement.
2696 (finish_mem_initializers): Pass pointer to
2697 check_for_bare_parameter_packs.
2698 (finish_member_declaration): Ditto.
2699 * parser.c (cp_parser_base_clause): Ditto.
2701 2007-11-06 Jakub Jelinek <jakub@redhat.com>
2704 * decl.c (cp_finish_decl): Call make_rtl_for_nonlocal_decl already
2705 with the final TREE_READONLY flag in place. processing_template_decl
2706 is known to be 0 in this part of function.
2709 * cp-tree.h: Update comment - TYPE_LANG_FLAG_0 is not
2710 OMP_ATOMIC_DEPENDENT_P in OMP_ATOMIC.
2711 * pt.c (tsubst_expr): Assert OMP_ATOMIC_DEPENDENT_P.
2712 * semantics.c (finish_omp_atomic): Revert most of the
2713 2007-02-05 changes, just keep the new representation of
2714 OMP_ATOMIC_DEPENDENT_P OMP_ATOMIC.
2716 2007-11-05 H.J. Lu <hongjiu.lu@intel.com>
2719 * decl2.c (constrain_visibility): Clear DECL_ONE_ONLY if marked
2722 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
2727 * typeck.c (merge_types): Don't lose rvalue references when
2729 * call.c (build_over_call): Don't elide move constructors just
2730 because the copy constructor is trivial (!).
2731 (compare_ics): If comparing cv-qualifiers fails, we can still order
2732 based on binding lvalues vs. rvalues.
2734 2007-11-05 Douglas Gregor <doug.gregor@gmail.com>
2737 * pt.c (unify_pack_expansion): bring handling of function call
2738 arguments into line with type_unification_real.
2740 2007-11-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2742 * typeck.c (build_binary_op): Use pedwarn instead of error for
2745 2007-11-05 Jakub Jelinek <jakub@redhat.com>
2748 * parser.c (cp_parser_unary_expression): For &&label call
2749 cp_parser_non_integral_constant_expression and return error_mark_node
2750 if it returned true.
2753 * decl.c (grokdeclarator): Don't call build_memfn_type if type
2754 is neither FUNCTION_TYPE nor METHOD_TYPE.
2756 2007-11-02 Jakub Jelinek <jakub@redhat.com>
2759 * parser.c (cp_parser_nested_name_specifier_opt): Use
2760 TYPE_MAIN_VARIANT (new_scope) as scope if new_scope is an incomplete
2761 typedef of currently open class.
2763 2007-11-02 Paolo Carlini <pcarlini@suse.de>
2766 * error.c (dump_expr): Deal specially with statements.
2768 2007-11-01 Jason Merrill <jason@redhat.com>
2771 * pt.c (push_template_decl_real): Set DECL_CONTEXT on template
2773 (lookup_template_class): Use it to get the outer template args
2774 for instantiating one.
2777 * pt.c (reduce_template_parm_level): tsubst the parameters
2778 of a template template parm.
2780 2007-11-01 Douglas Gregor <doug.gregor@gmail.com>
2783 * pt.c (find_parameter_packs_r): Handle TYPENAME_TYPE.
2785 2007-11-01 Jakub Jelinek <jakub@redhat.com>
2788 * parser.c (cp_parser_postfix_dot_deref_expression): If
2789 POSTFIX_EXPRESSION is type dependent, try to parse it as pseudo dtor
2790 first and if that succeeds and type is SCALAR_TYPE_P, create
2794 * rtti.c (enum_tinfo_kind): Fix TK_TYPE_INFO_TYPE comment.
2795 (typeid_ok_p): Use the same alias set for abi::__type_info_pseudo
2796 as for std::type_info.
2798 2007-10-31 Paolo Carlini <pcarlini@suse.de>
2801 * cxx-pretty-print.c (pp_cxx_typeid_expression,
2802 pp_cxx_delete_expression): Change to static linkage.
2803 * cxx-pretty-print.h: Adjust declarations.
2804 * error.c (dump_expr, case EXPR_PACK_EXPANSION, TYPEID_EXPR,
2805 MEMBER_REF, DOTSTAR_EXPR, DELETE_EXPR, VEC_DELETE_EXPR,
2806 MODOP_EXPR): Forward to pp_expression.
2808 * cxx-pretty-print.c (pp_cxx_expression, case NON_DEPENDENT_EXPR):
2811 2007-10-31 Christian Bruel <christian.bruel@st.com>
2812 Mark Mitchell <mark@codesourcery.com>
2815 * typeck.c (check_return_expr): Don't set named_return_value_okay_p
2816 if retval is volatile.
2818 2007-10-30 Jakub Jelinek <jakub@redhat.com>
2821 * decl2.c (build_offset_ref_call_from_tree): Call
2822 build_non_dependent_expr on object prior to building ADDR_EXPR from it
2823 if FN is DOTSTAR_EXPR.
2825 2007-10-30 Douglas Gregor <doug.gregor@gmail.com>
2829 * pt.c (find_parameter_packs_r): Fix typo in comment.
2830 (convert_template_argument): Look at the pattern of a pack
2831 expansion to determine what kind of entity we're converting.
2832 (coerce_template_parameter_pack): When we have coerced a non-type
2833 template parameter pack, substitute into the type of that pack.
2834 (tsubst_pack_expansion): When our substitution of a parameter pack
2835 is a "trivial" substitution of itself, just substitute into the
2836 pack expansion rather than actually expanding.
2838 2007-10-29 Jakub Jelinek <jakub@redhat.com>
2841 * class.c (check_bitfield_decl): Don't set field's type to error_mark_node
2842 for non-integral type bitfields. Return true if bitfield is correct, false
2843 error has been diagnosed.
2844 (check_field_decls): If check_bitfield_decl returned false, call also
2847 2007-10-28 Paolo Carlini <pcarlini@suse.de>
2848 Mark Mitchell <mark@codesourcery.com>
2851 * pt.c (do_decl_instantiation): If the VAR_DECL is not a
2852 class member error out and return.
2854 2007-10-27 Jakub Jelinek <jakub@redhat.com>
2856 * error.c (reinit_cxx_pp): Initialize cxx_pp->enclosing_scope
2857 to current_function_decl rather than 0.
2860 * cxx-pretty-print.c (pp_cxx_pm_expression) <case MEMBER_REF>: Print
2862 * error.c (dump_expr): Handle MEMBER_REF and DOTSTAR_EXPR.
2864 2007-10-27 Jason Merrill <jason@redhat.com>
2867 * call.c (convert_default_arg): Detect recursion.
2869 2007-10-27 Jakub Jelinek <jakub@redhat.com>
2872 * cxx-pretty-print.h (pp_cxx_offsetof_expression): New prototype.
2873 * cxx-pretty-print.c (pp_cxx_primary_expression): Handle
2875 (pp_cxx_offsetof_expression_1, pp_cxx_offsetof_expression): New
2877 * error.c (dump_expr): Handle OFFSETOF_EXPR.
2879 2007-10-26 Jason Merrill <jason@redhat.com>
2882 * pt.c (get_template_info): New fn.
2883 (template_class_depth): Use it.
2884 (push_template_decl_real): Check that the template args of the
2885 definition match the args of the previous declaration.
2887 2007-10-26 Paolo Carlini <pcarlini@suse.de>
2890 * decl2.c (coerce_new_type): Do not allow a default argument for
2891 the first parameter.
2893 2007-10-26 Douglas Gregor <doug.gregor@gmail.com>
2896 * parser.c (cp_parser_decltype): Return ERROR_MARK_NODE if we
2897 don't see the leading '('. Only lookup names if we get an
2900 2007-10-26 Jakub Jelinek <jakub@redhat.com>
2903 * parser.c (cp_parser_parenthesized_expression_list): Set
2904 greater_than_is_operator_p to true in between the parens.
2906 2007-10-26 Paolo Carlini <pcarlini@suse.de>
2909 * decl.c (grokdeclarator): In case of conflicting specifiers
2910 just return error_mark_node.
2912 2007-10-26 Ollie Wild <aaw@google.com>
2914 * expr.c (cxx_expand_expr): Removed.
2915 * cp-tree.h (exx_expand_expr): Removed.
2916 * cp-objcp-common.h (LANK_HOOKS_EXPAND_EXPR): Replace cxx_expand_expr
2919 2007-10-25 Paolo Carlini <pcarlini@suse.de>
2922 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with BIT_NOT_EXPR.
2924 2007-10-23 Jason Merrill <jason@redhat.com>
2926 PR c++/25950 (DR 391)
2927 * call.c (struct conversion): Remove check_copy_constructor_p.
2928 (reference_binding): Always bind a reference directly to a
2929 compatible class rvalue. Pass down LOOKUP_NO_TEMP_BIND during
2931 (check_constructor_callable): Remove.
2932 (convert_like_real): Don't call it.
2933 (initialize_reference): Don't call check_constructor_callable.
2934 (standard_conversion): Check LOOKUP_NO_CONVERSION instead of
2935 LOOKUP_CONSTRUCTOR_CALLABLE. Don't require a temporary for base
2936 conversions if LOOKUP_NO_TEMP_BIND.
2937 (implicit_conversion): Pass through LOOKUP_NO_TEMP_BIND.
2938 (build_user_type_conversion_1): Pass through LOOKUP_NO_TEMP_BIND for
2940 * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): Remove.
2942 2007-10-22 Jakub Jelinek <jakub@redhat.com>
2945 * semantics.c (finish_omp_clauses): Check !type_dependent_expression_p
2946 before checking if its type is integral.
2948 2007-10-22 Jason Merrill <jason@redhat.com>
2951 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES.
2952 * pt.c (apply_late_template_attributes): Splice out dependent
2953 attributes from DECL_ATTRIBUTES.
2955 * decl.c (cxx_maybe_build_cleanup): Use build_address.
2957 2007-10-17 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
2959 * typeck.c (build_binary_op) : Use appropriate warning option
2960 instead of unnamed warning.
2962 2007-10-16 Paolo Carlini <pcarlini@suse.de>
2965 * pt.c (current_template_args): Do not change TREE_LIST elements
2966 with a TREE_VALUE of error_mark_node.
2968 2007-10-16 Mark Mitchell <mark@codesourcery.com>
2970 * typeck.c (cp_apply_type_quals_to_decl): Expand documentation.
2971 * decl.c (start_decl): Tidy.
2972 (start_decl_1): Call cp_apply_type_quals_to_decl after completing
2974 (grokdeclarator): Clarify comment.
2976 2007-10-14 Andrew Pinski <pinskia@gmail.com>
2979 * decl.c (grokfndecl): Return NULL after the "definition of
2980 implicitly-declared" error happened.
2982 2007-10-12 Simon Martin <simartin@users.sourceforge.net>
2985 * call.c (build_user_type_conversion_1): Do not consider conversion
2986 functions to convert a (possibly cv-qualified) object to the (possibly
2987 cv-qualified) same object type (or a reference to it), to a (possibly
2988 cv-qualified) base class of that type (or a reference to it).
2990 2007-10-12 Paolo Carlini <pcarlini@suse.de>
2992 * pt.c (tsubst): Use template_parm_level_and_index.
2994 2007-10-12 Jakub Jelinek <jakub@redhat.com>
2997 * parser.c (cp_parser_compound_statement): Handle label-declarations
2998 at the beginning of the compound statement.
2999 (cp_parser_block_declaration): Issue diagnostics about __label__
3000 not at the beginning of a block.
3002 2007-10-11 Paolo Carlini <pcarlini@suse.de>
3005 * pt.c (coerce_template_parameter_pack): Do not pass error_mark_node
3006 to convert_template_argument.
3007 (coerce_template_parms): Return error_mark_node after fixed-length
3009 (tsubst_decl): Check for error_mark_node the return value of the
3010 first tsubst in 'case VAR_DECL'.
3012 2007-10-08 Ollie Wild <aaw@google.com>
3014 * typeck2.c (digest_init): Call cplus_expand_constant after
3015 convert_for_initialization.
3016 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3017 * expr.c (cplus_expand_constant): Updated function description.
3019 2007-10-04 Jason Merrill <jason@redhat.com>
3022 * call.c (initialize_reference): Handle local static reference
3025 2007-10-03 Jason Merrill <jason@redhat.com>
3028 * name-lookup.c (push_namespace_with_attrs): Fold back into...
3029 (push_namespace): Here.
3030 (handle_namespace_attrs): New fn for the attr code.
3031 (leave_scope): Don't pop_visibility.
3032 * name-lookup.h (struct cp_binding_level): Remove has_visibility.
3033 * parser.c (cp_parser_namespace_definition): Call
3034 handle_namespace_attrs and pop_visibility as appropriate.
3037 * mangle.c (write_type) [TYPEOF_TYPE]: Just sorry.
3039 2007-10-03 Alexandre Oliva <aoliva@redhat.com>
3041 * decl.c (duplicate_decls): Preserve linkage flags for mere
3042 redeclarations of gnu_inline definitions.
3044 2007-10-03 Jason Merrill <jason@redhat.com>
3047 * decl.c (wrap_cleanups_r): New fn.
3048 (wrap_temporary_cleanups): New fn.
3049 (initialize_local_var): Call it.
3051 2007-09-29 Jason Merrill <jason@redhat.com>
3054 * decl.c (make_rtl_for_nonlocal_decl): It's ok for a member
3055 constant to not have DECL_EXTERNAL if it's file-local.
3057 2007-09-28 Ollie Wild <aaw@google.com>
3060 2007-09-27 Ollie Wild <aaw@google.com>
3062 * typeck2.c (digest_init): Call cplus_expand_constant after
3063 convert_for_initialization.
3064 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3065 * expr.c (cplus_expand_constant): Updated function description.
3067 2007-09-28 Jason Merrill <jason@redhat.com>
3070 * class.c (layout_empty_base): Take rli parameter, update
3071 rli->record_align if empty base has user-specified alignment.
3072 (build_base_field): Pass rli to it.
3074 2007-09-28 Paolo Carlini <pcarlini@suse.de>
3077 * error.c (dump_decl): Deal with TYPE_PACK_EXPANSION.
3079 2007-09-28 Paolo Carlini <pcarlini@suse.de>
3082 * error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
3083 (dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
3084 (dump_parameters): Just call dump_type for argument packs too.
3086 2007-09-28 Jakub Jelinek <jakub@redhat.com>
3089 * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
3090 qualification by creating qualified PACK_EXPANSION_PATTERN and
3091 then calling make_pack_expansion on it.
3093 2007-09-27 Ollie Wild <aaw@google.com>
3095 * typeck2.c (digest_init): Call cplus_expand_constant after
3096 convert_for_initialization.
3097 * cp-objcp-common.h (LANG_HOOKS_EXPAND_CONSTANT): Removed.
3098 * expr.c (cplus_expand_constant): Updated function description.
3100 2007-09-27 Jason Merrill <jason@redhat.com>
3103 * decl2.c (is_late_template_attribute): Don't crash on unknown
3106 2007-09-27 Paolo Carlini <pcarlini@suse.de>
3109 * error.c (dump_expr): Deal with DELETE_EXPR and VEC_DELETE_EXPR.
3110 * cxx-pretty-print.c (pp_cxx_delete_expression): Add missing
3111 spaces in the formatting.
3112 * cxx-pretty-print.h (pp_cxx_delete_expression): Declare.
3114 2007-09-27 Jakub Jelinek <jakub@redhat.com>
3116 * error.c (cxx_print_error_function): Add third argument, pass
3117 it over to lhd_print_error_function.
3118 (cp_print_error_function): If diagnostic->abstract_origin, print
3120 * cp-tree.h (struct diagnostic_info): New forward decl.
3121 (cxx_print_error_function): Add third argument.
3123 2007-09-25 Simon Martin <simartin@users.sourceforge.net>
3126 * name-lookup.c (pushtag): Do not create an implicit typedef before
3127 the associated type declaration is known to be valid.
3129 2007-09-25 Jakub Jelinek <jakub@redhat.com>
3131 * tree.c (cxx_printable_name): Compare FUNCTION_DECL uids
3132 rather than pointers.
3134 2007-09-24 Danny Smith <dannysmith@user.sourceforge.net>
3137 * search.c (check_final_overrider): Fail if
3138 targetm.comp_type_attributes returns 0.
3140 2007-09-24 Jason Merrill <jason@redhat.com>
3143 * pt.c (resolve_typename_type): Don't look things up in the original
3144 template if it would mean losing template arguments.
3146 2007-09-24 Jakub Jelinek <jakub@redhat.com>
3149 * cp-tree.h (cxx_type_hash_eq): New prototype.
3150 * cp-objcp-common.h (LANG_HOOKS_TYPE_HASH_EQ): Redefine.
3151 * tree.c (cxx_type_hash_eq): New function.
3153 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
3156 * tree.c (cp_build_qualified_type_real): Build a canonical
3157 ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
3159 2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
3163 * tree.c (cplus_array_compare): Compare pointers, not types.
3164 (build_cplus_array_type_1): Store new array type into the hash
3165 table before building the canonical type; build the canonical type
3167 (cp_build_qualified_type_real): Put all of the array types with
3168 cv-qualified element types into the C++ array hash table, built as
3169 variants of the unqualified versions.
3171 2007-09-23 Jason Merrill <jason@redhat.com>
3174 * decl.c (grokdeclarator): Look through implicit TYPE_DECLs
3175 for deprecation warnings.
3177 2007-09-22 Jason Merrill <jason@redhat.com>
3180 * call.c (build_over_call): Warn about deprecated virtuals.
3183 * cp-tree.h (ATTR_IS_DEPENDENT): New macro.
3184 (MAYBE_TAGGED_TYPE_P): Remove.
3185 * pt.c (apply_late_template_attributes): Check ATTR_IS_DEPENDENT
3186 instead of calling is_late_template_attribute again.
3187 (tsubst_decl) [TYPE_DECL]: Just check if the name is the tag.
3188 (tsubst): A typedef is a TYPE_NAME != TYPE_MAIN_DECL.
3189 Don't crash on typedefs from non-template classes.
3190 * decl2.c (grokfield): Don't sorry about attrs on template parms.
3191 (is_late_template_attribute): All attributes applied to template
3192 parms or typename types are dependent. Static.
3193 (splice_template_attributes): Pass decl through.
3194 (save_template_attributes): Likewise.
3196 2007-09-20 Jakub Jelinek <jakub@redhat.com>
3199 * pt.c (tsubst_copy) <case SIZEOF_EXPR>: Handle error_mark_node
3200 returned from tsubst_pack_expansion.
3201 (tsubst_copy_and_build) <case SIZEOF_EXPR>: Likewise.
3202 (tsubst_copy_and_build) <case CONSTRUCTOR>: Likewise.
3204 2007-09-20 Paolo Carlini <pcarlini@suse.de>
3207 * semantics.c (finish_id_expression): Use consistently
3208 context_for_name_lookup.
3209 * decl.c (fixup_anonymous_aggr): Fix error message for
3210 anonymous struct (vs union).
3212 2007-09-19 Jason Merrill <jason@redhat.com>
3215 * pt.c (tsubst): Handle typedefs by looking for the specialization.
3216 (retrieve_specialization): Only tagged types use
3217 DECL_TEMPLATE_INSTANTIATIONS.
3218 (instantiate_class_template): Push nested classes too.
3219 (tsubst_decl) [TYPE_DECL]: Only check for canonical decl for
3221 * cp-tree.h (MAYBE_TAGGED_TYPE_P): New macro.
3222 * init.c (is_aggr_type): Remove redundant tests.
3223 * class.c (push_nested_class): Use CLASS_TYPE_P.
3225 2007-09-20 Paolo Carlini <pcarlini@suse.de>
3228 * init.c (build_zero_init): If, recursively, build_zero_init
3229 returns a NULL_TREE, do not append it to the VEC of constructors.
3231 2007-09-18 Jason Merrill <jason@redhat.com>
3234 * pt.c (apply_late_template_attributes): Set processing_template_decl.
3235 (tsubst_decl) [TYPE_DECL]: Preserve naming typedef, pass
3236 ATTR_FLAG_TYPE_IN_PLACE.
3237 (tsubst): Do unqualified lookup to find typedefs from current class.
3238 [ARRAY_TYPE]: Propagate alignment info.
3239 * decl2.c (is_late_template_attribute): Only defer handling of
3240 attribute aligned if the expression is dependent.
3241 (save_template_attributes): If we're deferring any attributes,
3242 make this a naming typedef.
3244 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3246 PR c++/33462 (again)
3247 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Print
3248 va_arg instead of __builtin_va_arg.
3250 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3253 * cxx-pretty-print.c (pp_cxx_va_arg_expression): Add.
3254 (pp_cxx_primary_expression): Use it.
3255 * cxx-pretty-print.h (pp_cxx_va_arg_expression): Declare.
3256 * error.c (dump_expr): Use it.
3258 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3261 * cxx-pretty-print.c (pp_cxx_postfix_expression): Split
3262 out case TYPEID_EXPR to...
3263 (pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
3264 and pp_cxx_right_paren.
3265 * cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
3266 * error.c (dump_expr): Use it.
3268 2007-09-18 Paolo Carlini <pcarlini@suse.de>
3271 * cxx-pretty-print.c (pp_cxx_trait_expression): Add.
3272 (pp_cxx_primary_expression): Use it.
3273 * cxx-pretty-print.h (pp_cxx_trait_expression): Declare.
3274 * error.c (dump_expr): Use it.
3276 2007-09-16 Paolo Carlini <pcarlini@suse.de>
3279 * init.c (build_new): Remove warning for zero-element
3282 2007-09-16 Nathan Sidwell <nathan@codesourcery.com>
3285 * call.c (maybe_handle_implicit_object): Set this_p, clear
3286 rvaluedness_matches_p.
3287 (compare_ics): Do not compare rvaluedness matching when one of the
3288 operands is an implicit object.
3290 2007-09-14 Jason Merrill <jason@redhat.com>
3292 PR c++/17743, c++/19163
3293 * decl2.c (is_late_template_attribute): New fn.
3294 (splice_template_attributes, save_template_attributes): New fns.
3295 (cplus_decl_attributes): Call save_template_attributes.
3296 * pt.c (apply_late_template_attributes): New fn.
3297 (instantiate_class_template, tsubst_decl): Use it.
3298 * cp-tree.h: Declare is_late_template_attribute.
3300 2007-09-13 Tom Tromey <tromey@redhat.com>
3302 * parser.c (cp_lexer_new_main): Don't use
3303 c_lex_return_raw_strings.
3304 (cp_lexer_get_preprocessor_token): Update. Add special case when
3307 2007-09-11 Jan Hubicka <jh@suse.cz>
3309 * method.c (use_thunk): Use tree_rest_of_compilation
3310 * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
3311 (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
3312 * cp-tree.h (expand_body): Kill.
3313 (emit_associated_thunks): Declare.
3314 * semantics.c (emit_associated_thunks): Export.
3315 (expand_body): Kill.
3317 2007-09-09 David Daney <ddaney@avtrex.com>
3320 * init.c (build_new_1): Use POINTER_PLUS_EXPR instead of MINUS_EXPR
3321 to calculate cookie_ptr.
3323 2007-09-08 Jason Merrill <jason@redhat.com>
3326 * pt.c (most_specialized_class): Set processing_template_decl
3327 while tsubsting partial spec args.
3329 2007-09-06 Jason Merrill <jason@redhat.com>
3331 * decl2.c (get_guard): Copy visibility from the guarded variable.
3333 2007-09-06 Jan Hubicka <jh@suse.cz>
3335 * semantics.c (expand_body): Do not mark arguments of clones used.
3337 2007-09-06 Paolo Carlini <pcarlini@suse.de>
3340 * decl.c (cp_finish_decl): When processing_template_decl,
3341 deal correctly with init as TREE_LIST.
3343 2007-09-06 Tom Tromey <tromey@redhat.com>
3345 * decl.c (finish_function): Put return's location on line zero of
3348 2007-09-05 Jason Merrill <jason@redhat.com>
3351 * except.c (prepare_eh_type): Use type_decays_to.
3354 * init.c (build_delete): Use build_headof to get the address of the
3355 complete object if we aren't using the deleting destructor.
3356 * rtti.c (build_headof): No longer static.
3357 * cp-tree.h: Declare it.
3359 2007-09-06 Jakub Jelinek <jakub@redhat.com>
3361 * decl.c (duplicate_decls): Set TREE_NOTHROW on __builtin_XX
3362 decl if a prototype for XX is provided with throw().
3365 * decl.c (builtin_function_1): Set DECL_ANTICIPATED also
3366 on __*_chk non-__builtin_* decls.
3368 2007-09-05 Paolo Carlini <pcarlini@suse.de>
3371 * semantics.c (finish_id_expression): Use context_for_name_lookup
3372 insted of DECL_CONTEXT, to see through anonymous structs and unions.
3373 * class.c (finish_struct_anon): Deal correctly with anonymous
3374 structs (vs unions, as GNU extension) in error messages.
3376 2007-09-05 Jan Hubicka <jh@suse.cz>
3378 * sematics.c (expand_body): Remove unnecesary import_export_decl
3379 call, DECL_EXTERNAL checks and current_function_decl saving.
3381 2007-09-05 Paolo Carlini <pcarlini@suse.de>
3383 PR c++/29731 (again)
3384 * parser.c (cp_parser_primary_expression): Return error_mark_node
3385 when a statement-expression is found in a template-argument list.
3387 2007-09-04 Jason Merrill <jason@redhat.com>
3389 * except.c (initialize_handler_parm): Use
3390 fold_build_cleanup_point_expr.
3393 * call.c (reference_binding): Don't look for user-defined conversions
3397 * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
3398 the MUST_NOT_THROW_EXPR.
3400 2007-09-04 Richard Sandiford <richard@codesourcery.com>
3402 * decl.c (cp_finish_decl): Call determine_visibility before
3403 make_rtl_for_nonlocal_decl.
3405 2007-09-04 Jason Merrill <jason@redhat.com>
3408 * pt.c (most_specialized_class): Substitute outer template
3409 arguments into the arguments of a member template partial
3411 (strip_innermost_template_args): New fn.
3413 2007-09-03 Daniel Jacobowitz <dan@codesourcery.com>
3415 * Make-lang.in (g++spec.o): Remove SHLIB_MULTILIB.
3417 2007-09-03 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3419 * call.c (name_as_c_string): Supply a TYPE for CONST_CAST.
3420 * decl.c (cp_make_fname_decl): Likewise,
3421 * parser.c (cp_parser_string_literal): Likewise,
3422 * tree.c (pod_type_p, zero_init_p): Use CONST_CAST_TREE.
3423 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
3426 2007-09-02 Paolo Carlini <pcarlini@suse.de>
3429 * typeck.c (build_unary_op): Fix error message for
3430 Boolean expression as operand to operator--.
3432 2007-09-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3434 * tree.c (pod_type_p, zero_init_p): Use strip_array_types.
3435 * typeck.c (cp_type_quals, cp_type_readonly, cp_has_mutable_p):
3438 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
3441 * init.c (build_default_init): Make extern.
3442 * cp-tree.h (build_default_init): Declare here.
3443 * pt.c (tsubst_expr): When the instantiation of the initializer of
3444 a variable results in an empty list, default-initialize the
3446 (tsubst_copy_and_build): When the instantiation of the initializer
3447 in a new expression results in an empty initializer list,
3448 default-initialize it.
3450 2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
3452 * mangle.c (write_type): Change mangling of rvalue reference from
3455 2007-08-31 Jakub Jelinek <jakub@redhat.com>
3457 * decl.c (duplicate_decls): Remove duplicated line.
3459 2007-08-31 Paolo Carlini <pcarlini@suse.de>
3462 * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
3463 BOUND_TEMPLATE_TEMPLATE_PARM.
3465 2007-08-31 Paolo Carlini <pcarlini@suse.de>
3468 * search.c (lookup_member): Check the name argument for
3471 2007-08-31 Paolo Carlini <pcarlini@suse.de>
3474 * parser.c (cp_parser_trait_expr): Check rerurn value of
3477 2007-08-30 Ollie Wild <aaw@google.com>
3479 * cvt.c (cp_convert_to_pointer): Remove force parameter. Call
3480 convert_ptrmem for pointer to member conversions.
3481 (convert_to_pointer_force): Update cp_convert_to_pointer call.
3482 (ocp_convert): Update cp_convert_to_pointer call.
3483 * typeck.c (convert_ptrmem): Add conditional for null pointers to
3485 (build_static_cast_1): Check can_convert for conversions in either
3487 (get_delta_difference_1): New function.
3488 (get_delta_difference): Refactor to call get_delta_difference_1.
3490 2007-08-30 Jakub Jelinek <jakub@redhat.com>
3492 * decl.c (start_preparsed_function): Set
3493 DECL_DISREGARD_INLINE_LIMITS for GNU_INLINE_P functions.
3495 2007-08-28 Paolo Carlini <pcarlini@suse.de>
3498 * error.c (dump_expr): Deal with TEMPLATE_TYPE_PARM and
3499 BOUND_TEMPLATE_TEMPLATE_PARM.
3501 2007-08-28 Jakub Jelinek <jakub@redhat.com>
3505 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN
3506 and DECL_NOT_REALLY_EXTERN if tmpl_func is not public.
3508 2007-08-27 Jason Merrill <jason@redhat.com>
3511 * pt.c (build_non_dependent_expr, type_dependent_expression_p):
3512 Look inside STMT_EXPR.
3513 * semantics.c (stmt_expr_value_expr): New fn.
3514 * cp-tree.h: Declare it.
3517 * decl.c (groktypename): Ignore attributes applied to class type.
3519 2007-08-28 Richard Guenther <rguenther@suse.de>
3521 * decl.c (duplicate_decls): Merge DECL_DISREGARD_INLINE_LIMITS.
3523 2007-08-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
3525 * error.c (dump_expr): Handle COMPLEX_CST.
3526 * cxx-pretty-print.c (pp_cxx_primary_expression): Likewise.
3527 (pp_cxx_expression): Likewise.
3529 2007-08-27 Alexandre Oliva <aoliva@redhat.com>
3531 * decl.c (GNU_INLINE_P): New.
3532 (duplicate_decls): Handle gnu_inline. Merge attributes and
3533 some flags in overriding definitions.
3534 (redeclaration_error_message): Handle gnu_inline.
3535 (start_preparsed_function): Likewise.
3537 2007-08-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3539 * call.c (sufficient_parms_p): Constify.
3540 * class.c (same_signature_p): Likewise.
3541 * cp-gimplify.c (is_invisiref_parm,
3542 cxx_omp_privatize_by_reference): Likewise.
3543 * cp-objcp-common.c (has_c_linkage): Likewise.
3544 * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK,
3545 sufficient_parms_p, same_signature_p, copy_fn_p, move_fn_p,
3546 grok_ctor_properties, nothrow_libfn_p, skip_artificial_parms_for,
3547 num_artificial_parms_for, comp_template_parms,
3548 template_parameter_pack_p, any_dependent_template_arguments_p,
3549 any_type_dependent_arguments_p, any_value_dependent_elements_p,
3550 repo_export_class_p, cxx_omp_privatize_by_reference, pod_type_p,
3551 zero_init_p, member_p, cp_lvalue_kind,
3552 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
3553 varargs_function_p, is_dummy_object, special_function_kind,
3554 string_conv_p, type_unknown_p, comp_except_specs, compparms,
3555 comp_cv_qualification, is_bitfield_expr_with_lowered_type,
3556 unlowered_expr_type, ptr_reasonably_similar, cp_type_readonly,
3557 cp_has_mutable_p, at_least_as_qualified_p,
3558 invalid_nonstatic_memfn_p, lvalue_or_else, lvalue_p): Likewise.
3559 * decl.c (copy_fn_p, move_fn_p, grok_ctor_properties): Likewise.
3560 * except.c (nothrow_libfn_p): Likewise.
3561 * method.c (skip_artificial_parms_for, num_artificial_parms_for):
3563 * pt.c (comp_template_parms, template_parameter_pack_p,
3564 any_type_dependent_arguments_p, any_value_dependent_elements_p,
3565 any_dependent_template_arguments_p): Likewise.
3566 * repo.c (repo_export_class_p): Likewise.
3567 * semantics.c (anon_aggr_type_p): Likewise.
3568 * tree.c (lvalue_p_1, real_lvalue_p, lvalue_p,
3569 builtin_valid_in_constant_expr_p, decl_anon_ns_mem_p,
3570 varargs_function_p, member_p, is_dummy_object, pod_type_p,
3571 zero_init_p, special_function_p): Likewise.
3572 * typeck.c (comp_array_types, type_unknown_p, comp_except_specs,
3573 comp_array_types, at_least_as_qualified_p, comp_cv_qualification,
3574 compparms, invalid_nonstatic_memfn_p,
3575 is_bitfield_expr_with_lowered_type, unlowered_expr_type,
3576 string_conv_p, ptr_reasonably_similar, cp_type_readonly,
3577 cp_has_mutable_p, lvalue_or_else): Likewise.
3579 2007-08-25 Paolo Bonzini <bonzini@gnu.org>
3581 * decl.c (cp_tree_node_structure): Kill TINST_LEVEL case.
3582 * cp-objcp-common.c (cp_tree_size): Ditto.
3583 * tree.c (cp_walk_subtrees): Ditto
3584 * cp-tree.def (TINST_LEVEL): Go away.
3585 * cp-tree.h (struct tinst_level_s): Rename to struct tinst_level,
3586 move together with other non-tree structs.
3587 (enum cp_tree_node_structure_enum): Nuke TS_CP_TINST_LEVEL.
3588 (union lang_tree_node): Eliminate tinst_level field.
3589 (TINST_DECL, TINST_LOCATION, TINST_IN_SYSTEM_HEADER_P): Annihilate.
3590 (current_instantiation, outermost_tinst_level): Return
3591 a "struct tinst_level *".
3593 * error.c (print_instantiation_partial_context): Change second
3594 parameter to a "struct tinst_level *". Replace accessor macros
3596 (print_instantiation_full_context): Likewise.
3597 * lex.c (in_main_input_context): Likewise.
3599 * pt.c (struct pending_templates): New.
3600 (pending_templates, last_pending_template): Use it as a type.
3601 (current_tinst_level): Change typo to "struct tinst_level *"
3602 (reopen_tinst_level): Accept "struct tinst_level *", return decl.
3603 (add_pending_template): Construct a "struct pending_template".
3604 Replace TINST_LEVEL accessor macros with field access.
3605 (push_tinst_level): Likewise, using GGC_NEW instead of make_node.
3606 (pop_tinst_level): Likewise.
3607 (instantiate_pending_templates): Likewise. Factor common code used
3608 when an instantiation has been done.
3609 (outermost_tinst_level): Replace tree_last with loop.
3610 (current_instantiation): Return a "struct tinst_level *".
3612 2007-08-24 Ollie Wild <aaw@google.com>
3614 * name-lookup.c (add_decl_to_level): Remove addition to vtables chain.
3615 * name-lookup.h (cp_binding_level): Remove vtables member.
3617 2007-08-24 Richard Guenther <rguenther@suse.de>
3619 * tree.c (cp_cannot_inline_tree_fn): Remove.
3620 * cp-tree.h (cp_cannot_inline_tree_fn): Likewise.
3621 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN):
3624 2007-08-24 Jakub Jelinek <jakub@redhat.com>
3627 * typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
3628 error_mark_node right away if build_expr_type_conversion
3632 * name-lookup.c (set_decl_namespace): lookup_qualified_name failure
3633 is error_mark_node rather than NULL_TREE.
3634 * pt.c (check_explicit_specialization): Likewise.
3637 * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
3638 TARGET_VTABLE_USES_DESCRIPTORS targets properly.
3640 2007-08-22 Jason Merrill <jason@redhat.com>
3643 * pt.c (outermost_tinst_level): New function.
3644 * lex.c (in_main_input_context): New function.
3645 * cp-tree.h: Declare it.
3646 * decl2.c (constrain_class_visibility): Use it to avoid warning
3647 about uses of the anonymous namespace in the main input file.
3649 2007-08-21 Jakub Jelinek <jakub@redhat.com>
3651 * init.c (build_new_1): Use get_target_expr instead of save_expr.
3653 2007-08-20 Pawel Sikora <pluto@pld-linux.org>
3656 * class.c (finish_struct_1): Warn when a class has virtual
3657 functions and accessible non-virtual destructor.
3659 2007-08-20 Richard Guenther <rguenther@suse.de>
3663 * call.c (build_new_method_call): Convert initializer to
3665 * init.c (build_aggr_init): Do not fiddle with types.
3666 (build_vec_delete_1): Use correct type for POINTER_PLUS_EXPR.
3667 * except.c (build_throw): Do not drop qualifiers for the
3669 * typeck.c (get_member_function_from_ptrfunc): Do not
3670 fiddle with types, instead convert.
3671 (build_ptrmemfunc1): Convert to the target type for
3673 (gfc_trans_allocate): Convert result to target type.
3674 * cp-objcp-common.c (cxx_get_alias_set): Pointers to
3675 pointer-to-member structures shall have alias set zero as well.
3677 2007-08-20 Richard Guenther <rguenther@suse.de>
3679 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
3681 * cp-tree.h (cp_auto_var_in_fn_p): Remove.
3682 (nonstatic_local_decl_p): Likewise.
3683 * tree.c (cp_auto_var_in_fn_p): Remove.
3684 * decl.c (nonstatic_local_decl_p): Remove.
3686 2007-08-20 Richard Guenther <rguenther@suse.de>
3688 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES):
3690 * tree.h (cp_walk_tree): New define to walk_tree_1 with
3691 cp_walk_subtrees lh parameter.
3692 (cp_walk_tree_without_duplicates): New define to
3693 walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter.
3694 * tree.c (count_trees): Call
3695 cp_walk_tree_without_duplicates.
3696 (verify_stmt_tree): Call cp_walk_tree.
3697 (break_out_target_exprs): Likewise.
3698 (WALK_SUBTREE): Likewise.
3699 * cp-gimplify.c (cp_genericize): Likewise.
3700 * cp-pt.c (find_parameter_packs_r): Likewise.
3701 (uses_parameter_packs): Likewise.
3702 (make_pack_expansion): Likewise.
3703 (check_for_bare_parameter_packs): Likewise.
3704 (for_each_template_parm): Likewise.
3705 * decl.c (check_default_argument): Call
3706 cp_walk_tree_without_duplicates.
3707 * except.c (build_throw): Likewise.
3708 * decl2.c (type_visibility): Likewise.
3709 * semantics.c (expand_or_defer_fn): Likewise.
3710 (finalize_nrv): Call cp_walk_tree.
3712 2007-08-20 Jakub Jelinek <jakub@redhat.com>
3715 * init.c (build_new_1): Rename placement_var variable to placement_expr.
3716 Initialize it with save_expr rather than get_temp_regvar.
3718 2007-08-17 Andrew Pinski <andrew_pinski@playstation.sony.com>
3721 * tree.c (lvalue_p_1 <case SAVE_EXPR>): SAVE_EXPRs are never
3724 2007-08-17 Ollie Wild <aaw@google.com>
3727 * name-lookup.c (do_nonmember_using_decl): Shift implicit type
3728 declarations into appropriate slots for comparison. Fix type
3731 2007-08-17 Paolo Carlini <pcarlini@suse.de>
3734 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE.
3735 * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise.
3737 2007-08-17 Paolo Carlini <pcarlini@suse.de>
3740 * parser.c (cp_parser_class_head): Improve error message.
3742 2007-08-16 Seongbae Park <seongbae.park@gmail.com>
3744 * pt.c (instantiate_decl): Set input_location
3745 for the function end.
3747 2007-08-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3749 * cp-objcp-common.c (cxx_warn_unused_global_decl, cp_expr_size):
3751 * cp-tree.h (local_variable_p, nonstatic_local_decl_p,
3752 class_tmpl_impl_spec_p, cp_auto_var_in_fn_p, cp_type_quals,
3753 cxx_incomplete_type_diagnostic, cxx_incomplete_type_error,
3754 cxx_warn_unused_global_decl, cp_expr_size): Likewise.
3755 * decl.c (local_variable_p, nonstatic_local_decl_p): Likewise.
3756 * tree.c (class_tmpl_impl_spec_p, cp_auto_var_in_fn_p): Likewise.
3757 * typeck.c (cp_type_quals): Likewise.
3758 * typeck2.c (cxx_incomplete_type_diagnostic,
3759 cxx_incomplete_type_error): Likewise.
3761 2007-08-16 Paolo Carlini <pcarlini@suse.de>
3764 * pt.c (tsubst_friend_function): When check_classfn
3765 returns error_mark_node likewise return it.
3767 2007-08-15 Jakub Jelinek <jakub@redhat.com>
3770 * typeck.c (check_return_expr): Don't NRV optimize vars in
3772 * decl.c (finish_function): Comment fix.
3774 2007-08-15 Paolo Carlini <pcarlini@suse.de>
3777 * pt.c (push_template_decl_real): Depending on TYPE_P
3778 use either TYPE_CONTEXT or DECL_CONTEXT.
3780 2007-08-14 Mark Mitchell <mark@codesourcery.com>
3782 * semantics.c (finish_omp_clauses): Strip a NOP_EXPR if
3783 constructors and destructors return this.
3785 2007-08-14 Paolo Carlini <pcarlini@suse.de>
3788 * decl2.c (check_classfn): Return error_mark_node in case of error;
3789 in that case, do not call add_method.
3790 * decl.c (start_decl): Deal with check_classfn returning
3792 (grokfndecl): Likewise.
3793 * pt.c (tsubst_friend_function): Likewise.
3795 2007-08-14 Andrew Pinski <pinskia@gmail.com>
3798 * typeck.c (build_binary_op): Disallow vector float types with
3799 BIT_IOR_EXPR, BIT_AND_EXPR, and BIT_XOR_EXPR.
3801 2007-08-11 Ian Lance Taylor <iant@google.com>
3803 * cp-objcp-common.c (cxx_get_alias_set): Change return type to
3805 * cp-tree.h (cxx_get_alias_set): Update declaration.
3807 2007-08-10 Ollie Wild <aaw@google.com>
3809 * name-lookup.c (do_nonmember_using_decl): Print an error for ambiguous
3811 (ambiguous_decl): Construct tree of ambiguous types. Remove extaneous
3813 (unqualified_namespace_lookup): Fix ambiguous_decl call.
3814 (lookup_using_namespace): Fix ambiguous_decl call.
3815 (qualified_lookup_using_namespace): Fix ambiguous_decl call.
3817 2007-08-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3819 * call.c (name_as_c_string): Use CONST_CAST.
3820 * decl.c (build_decl): Likewise.
3821 * parser.c (cp_parser_string_literal): Likewise.
3823 2007-08-10 Paolo Carlini <pcarlini@suse.de>
3826 * error.c (dump_expr): Consistently use the *_cxx_*
3827 variants of the pretty-print functions.
3829 2007-08-10 Paolo Carlini <pcarlini@suse.de>
3832 * decl.c (check_special_function_return_type): Just error
3833 on return type specified for conversion operator.
3835 2007-08-09 Daniel Berlin <dberlin@dberlin.org>
3837 * typeck2.c (readonly_error): Handle general expressions.
3838 * error.c (dump_expr): Handle POINTER_PLUS_EXPR
3840 2007-08-06 Dan Hipschman <dsh@google.com>
3842 * method.c (use_thunk): Use DECL_NAME instead of DECL_RTL to
3843 access function name.
3845 2007-08-04 Alfred Minarik <a.minarik@aon.at>
3848 * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header.
3849 * g++spec.c (lang_specific_driver): Check them.
3851 2007-08-06 Paolo Carlini <pcarlini@suse.de>
3854 * pt.c (inline_needs_template_parms): Fix comment; change return type
3857 2007-08-05 Volker Reichelt <v.reichelt@netcologne.de>
3860 2007-03-26 Dirk Mueller <dmueller@suse.de>
3862 * parser.c (cp_parser_member_declaration): Pedwarn
3863 about stray semicolons after member declarations.
3865 2007-08-02 Lee Millward <lee.millward@gmail.com>
3870 * parser.c (cp_parser_asm_definition): Detect and discard asm
3871 statements with invalid inputs or outputs.
3872 (cp_parser_asm_operand_list): Return error mark node if any
3873 of the operands are invalid. Adjust documentation.
3875 2007-08-02 Nick Clifton <nickc@redhat.com>
3877 * typeck.c: Change copyright header to refer to version 3 of the
3878 GNU General Public License and to point readers at the COPYING3
3879 file and the FSF's license web page.
3880 * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c,
3881 config-lang.in, cp-tree.def, call.c, decl.h, ptree.c,
3882 Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c,
3883 cp-objcp-common.h, except.c, error.c, operators.def, cvt.c,
3884 tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c,
3885 cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c,
3886 cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c,
3887 name-lookup.h, parser.c: Likewise.
3889 2007-08-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3892 * call.c (magic_varargs_p): Honor the "type generic" attribute.
3894 2007-07-30 Paolo Carlini <pcarlini@suse.de>
3897 * semantics.c (finish_label_stmt): Reject the __label__
3898 extension outside function scopes.
3900 2007-07-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3902 * parser.c (eof_token): Un-constify.
3903 (cp_lexer_new_main, cp_lexer_new_from_tokens, VEC_alloc,
3904 cp_lexer_consume_token, cp_lexer_purge_token): Remove spurious
3907 2007-07-28 Kazu Hirata <kazu@codesourcery.com>
3909 * pt.c, tree.c, typeck2.c: Fix comment typos.
3911 2007-07-28 Simon Martin <simartin@users.sourceforge.net>
3912 Mark Mitchell <mark@codesourcery.com>
3915 * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be
3916 hidden due to friend declarations in local classes.
3918 2007-07-27 Douglas Gregor <doug.gregor@gmail.com>
3920 * typeck.c (structural_comptypes): Compare DECLTYPE_TYPE nodes.
3921 * cp-tree.def (DECLTYPE_TYPE): New.
3922 * error.c (dump_type): Dump DECLTYPE_TYPE nodes.
3923 (dump_type_prefix): Ditto.
3924 (dump_type_suffix): Ditto.
3925 * tree.c (DECLTYPE_TYPE): Walk DECLTYPE_TYPE nodes.
3926 * mangle.c (write_type): Handle DECLTYPE_TYPE.
3927 * cp-tree.h (IS_AGGR_TYPE): DECLTYPE_TYPE nodes can be aggregate
3929 (DECLTYPE_TYPE_EXPR): New.
3930 (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): New.
3931 (finish_declared_type): Declare.
3932 * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Print
3933 DECLTYPE_TYPE nodes.
3934 (pp_cxx_type_id): Ditto.
3935 * pt.c (for_each_template_parm_r): Walk DECLTYPE_TYPE children.
3936 (tsubst): Substitute into a DECLTYPE_TYPE node.
3937 (tsubst_copy): Ditto.
3938 (unify): Cannot deduce anything from TYPEOF_TYPE or DECLTYPE_TYPE
3940 (dependent_type_p_r): DECLTYPE_TYPE types are always dependent.
3941 * semantics.c (finish_typeof): TYPEOF_TYPE types need to use
3942 structural equality (because we can't hash the expressions).
3943 (finish_declared_type): New.
3944 * lex.c (reswords): Add "decltype" keyword.
3945 * parser.c cp_lexer_next_token_is_decl_specifier_keyword
3946 (cp_parser_postfix_expression): Add member_access_only_p to
3947 restrict postfix expression to member access expressions.
3948 (cp_parser_unary_expression): Update call to
3949 cp_parser_postfix_expression to reflect new parameter.
3950 (cp_parser_declared_type): New.
3951 (cp_parser_simple_type_specifier): Parse decltype types.
3953 2007-07-27 Mark Mitchell <mark@codesourcery.com>
3956 * call.c (convert_for_arg_passing): Only widen bitfields to their
3957 declared types if necessary.
3959 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3961 * parser.c (cp_parser_string_literal, cp_parser_sizeof_operand):
3964 2007-07-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
3966 * decl.c (typename_hash, typename_compare): Constify.
3967 * mangle.c (hash_type, compare_type): Likewise.
3968 * pt.c (eq_local_specializations, hash_local_specialization):
3970 * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq,
3971 list_hash): Likewise.
3972 * typeck2.c (pat_compare): Likewise.
3974 2007-07-24 Nathan Sidwell <nathan@codesourcery.com>
3976 * method.c (implicitly_declare_fn): Increase alignment if member
3977 function pointer format requires it.
3979 2007-07-24 Paolo Carlini <pcarlini@suse.de>
3982 * typeck.c (check_return_expr): Do not pass a null argument
3985 2007-07-24 Paolo Carlini <pcarlini@suse.de>
3988 * decl.c (redeclaration_error_message): Call DECL_ANON_UNION_VAR_P
3991 2007-07-22 Nathan Sidwell <nathan@codesourcery.com>
3994 * typeck.c (convert_arguments): Only use default args if we have
3998 * typeck.c (structural_comptypes): No need to check
3999 resolve_typename_type return value here.
4000 * cp-tree.h (TYPENAME_IS_RESOLVING_P): New.
4001 * pt.c (resolve_typename_type): Follow typename typedefs. Return
4002 original type rather than error_mark_node in case of failure.
4003 * parser.c (cp_parser_nested_name_specifier_opt): Adjust
4004 resolve_typename_type result check.
4005 (cp_parser_direct_declarator, cp_parser_head,
4006 cp_parser_constructor_declarator_p): Likewise.
4008 2007-07-12 Kazu Hirata <kazu@codesourcery.com>
4010 * pt.c (template_parms_variadic_p): Remove.
4011 * cp-tree.h: Remove the prototype for template_parms_variadic_p.
4013 2007-07-12 Jakub Jelinek <jakub@redhat.com>
4016 * error.c (dump_expr) <case AGGR_INIT_EXPR>: Pass true as last
4017 argument to dump_aggr_init_expr_args instead of false.
4019 2007-07-11 Douglas Gregor <doug.gregor@gmail.com>
4021 * typeck.c (comptypes): When USE_CANONICAL_TYPES, use the
4022 canonical types; otherwise, fall back to structural type
4023 comparisons. If ENABLE_CHECKING and USE_CANONICAL_TYPES, give an
4024 internal compiler error if the canonical types are wrong.
4026 2007-07-11 Paolo Carlini <pcarlini@suse.de>
4029 * parser.c (cp_parser_make_indirect_declarator): When the
4030 the code argument is ERROR_MARK return cp_error_declarator.
4032 2007-07-09 Geoffrey Keating <geoffk@apple.com>
4035 * decl.c (cxx_init_decl_processing): Don't set
4036 force_align_functions_log.
4037 (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
4038 * typeck.c (cxx_alignof_expr): When alignof is used on a plain
4039 FUNCTION_DECL, return its alignment.
4041 2007-07-09 Richard Guenther <rguenther@suse.de>
4043 * decl.c (start_preparsed_function): Do not promote return type.
4045 2007-07-08 Paolo Carlini <pcarlini@suse.de>
4048 * pt.c (unify): Never pass error_mark_node to template_decl_level.
4050 2007-07-07 Mark Mitchell <mark@codesourcery.com>
4053 * pt.c (resolve_overloaded_unification): Robustify. Return a
4055 (type_unification_real): Adjust accordingly.
4057 2007-07-06 Richard Guenther <rguenther@suse.de>
4059 * init.c (build_new_1): Use the correct pointer type.
4060 * typeck2.c (build_m_component_ref): Likewise.
4062 2007-07-05 Mark Mitchell <mark@codesourcery.com>
4065 * init.c (build_zero_init): Always build an initializer for
4067 * typeck2.c (build_functional_cast): Use build_zero_init.
4070 * init.c (build_new_1): Always pass the allocation function to
4071 build_op_delete_call.
4072 * call.c (build_op_delete_call): Handle operator delete with a
4073 variable-argument list. Do not issue an error when no matching
4074 deallocation function is available for a new operator.
4077 * cp-tree.h (any_value_dependent_elements_p): Declare it.
4078 * decl.c (value_dependent_init_p): New function.
4079 (cp_finish_decl): Use it.
4080 * pt.c (value_dependent_expression_p): Use
4081 any_value_dependent_elements_p.
4082 * parser.c (cp_parser_primary_expression): Add comment about
4083 treating dependent qualified names as integral
4084 constant-expressions.
4086 2007-07-04 Douglas Gregor <doug.gregor@gmail.com>
4088 * decl.c (build_ptrmemfunc_type): Always use structural equality
4089 tests when comparing pointer-to-member-function types, because the
4090 handling of TYPE_GET_PTRMEMFUNC_TYPE currently defeats canonical
4093 2007-07-03 Mark Mitchell <mark@codesourcery.com>
4095 * init.c (build_new): Tweak comment.
4097 2007-06-29 Dave Brolley <brolley@redhat.com>
4100 * parser.c (cp_parser_new_type_id): Don't reduce a named array
4101 type to its base type and number of elements here.
4102 * init.c (build_new): Call complete_type_or_else to ensure that the
4103 type is complete and to issue a diagnostic if it is not.
4104 (build_new_1): Don't call complete_type_or_else here.
4106 2007-07-03 Richard Guenther <rguenther@suse.de>
4109 * class.c (fixed_type_or_null): Re-lookup the hashtable slot
4112 2007-07-02 Simon Baldwin <simonb@google.com>
4114 * parser.c (cp_parser_elaborated_type_specifier): Added a warning
4115 for inner-style nested forward declarations that don't declare
4118 2007-07-02 Jakub Jelinek <jakub@redhat.com>
4121 * semantics.c (finish_omp_clauses): Use %qD instead of %qE for
4122 DECL_P in not a variable and appears more than once error messages.
4124 2007-07-01 Ollie Wild <aaw@google.com>
4126 * name-lookup.c (ambiguous_decl): Fix case when new->value is hidden.
4127 (select_decl): Remove function.
4128 (unqualified_namespace_lookup): Populate binding by calling
4129 ambiguous_decl. Remove select_decl call.
4130 (lookup_qualified_name): Remove select_decl call.
4131 * decl.c (lookup_and_check_tag): Check for ambiguous references.
4132 * parser.c (cp_parser_elaborated_type_specifier): Skip redundant error
4133 generation when name lookup is ambiguous.
4135 2007-06-29 Douglas Gregor <doug.gregor@gmail.com>
4138 * init.c (build_new_1): Use structural equality on the copy of the
4141 2007-06-28 Geoffrey Keating <geoffk@apple.com>
4143 * decl2.c (determine_visibility): Implement
4144 flag_visibility_ms_compat effect on type info.
4145 * decl.c (cxx_init_decl_processing): Implement
4146 global effect of flag_visibility_ms_compat.
4148 2007-06-28 Geoffrey Keating <geoffk@apple.com>
4150 * decl2.c (start_objects): Mark constructor-running function
4153 2007-06-26 Simon Martin <simartin@users.sourceforge.net>
4156 * decl.c (grokdeclarator): Reset friendp for member functions declared
4157 friend of their own class.
4159 2007-06-23 Mark Mitchell <mark@codesourcery.com>
4161 * decl2.c (determine_visibility): Don't look for dllexport here.
4162 (determine_visibility_from_class): Tidy.
4164 2007-06-18 Simon Baldwin <simonb@google.com>
4167 * parser.c (cp_parser_single_declaration): Added check for storage
4168 class other than sc_none in parsed declaration, and a flag to indicate
4169 if the call is part of an explicit template specialization parse.
4170 * (cp_parser_explicit_specialization): Specialization check flag added
4171 to call to cp_parser_single_declaration(), set true.
4172 * (cp_parser_template_declaration_after_export): Specialization check
4173 flag added to call to cp_parser_single_declaration(), set false.
4174 * pt.c (check_explicit_specialization): Added code to copy visiblity
4175 and linkage from the templated function to the explicit specialization.
4177 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
4179 * typeck.c (build_binary_op): For templates build the
4180 expression in pieces to avoid the assert in build2_stat.
4181 (get_member_function_from_ptrfunc):
4182 Change over to using POINTER_PLUS_EXPR and convert
4183 the second operand to sizetype.
4184 * typeck2.c (build_m_component_ref): Likewise.
4185 * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR
4186 instead of PLUS_EXPR for pointers.
4187 (build_new_1): Likewise.
4188 (build_vec_delete_1): Likewise.
4189 (build_vec_delete): Likewise.
4190 * class.c (build_base_path): Likewise.
4191 (build_base_path): Likewise.
4192 (convert_to_base_statically): Likewise.
4193 (fixed_type_or_null): Handle POINTER_PLUS_EXPR.
4194 (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR
4195 instead of PLUS_EXPR.
4196 (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR
4197 instead of PLUS_EXPR for pointers.
4198 * call.c (build_special_member_call): Likewise.
4199 * rtti.c (build_headof): Likewise.
4200 Use sizetype instead of ptrdiff_type_node.
4201 (tinfo_base_init): Create a POINTER_PLUS_EXPR
4202 instead of PLUS_EXPR for pointers.
4203 * except.c (expand_start_catch_block): Do a
4204 NEGATIVE and then a POINTER_PLUS_EXPR instead
4206 * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert
4207 PLUS_EXPR on pointer types over to use
4208 POINTER_PLUS_EXPR and remove the conversion
4209 to the pointer types.
4210 * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for
4211 adding to a pointer type. Use size_int instead of
4212 ssize_int. Convert the index to sizetype before
4213 adding it to the pointer.
4215 2007-06-15 Mark Mitchell <mark@codesourcery.com>
4217 * cp-tree.h (DECL_VAR_MARKED_P): Remove.
4218 (DECL_ANON_UNION_VAR_P): New macro.
4219 * class.c (fixed_type_or_null): Tidy. Use a hash table, rather
4220 than DECL_VAR_MARKED_P, to keep track of which variables we have
4222 * decl.c (redeclaration_error_message): Complain about redeclaring
4223 anonymous union members at namespace scope.
4224 * decl2.c (build_anon_union_vars): Set DECL_ANON_UNION_VAR_P.
4226 2007-06-14 Geoff Keating <geoffk@apple.com>
4228 * decl2.c (determine_visibility): Ensure that functions with
4229 hidden types as parameters are hidden.
4232 * decl2.c (determine_visibility): Remove duplicate code for
4235 2007-06-12 Ian Lance Taylor <iant@google.com>
4238 * init.c (avoid_placement_new_aliasing): New static function.
4239 (build_new_1): Call it.
4241 2007-06-11 Rafael Avila de Espindola <espindola@google.com>
4243 * cp-objcp-common.h (LANG_HOOKS_SIGNED_TYPE): Remove.
4244 (LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): Remove.
4246 2007-06-08 Jakub Jelinek <jakub@redhat.com>
4249 * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
4250 on init, the non-decl cond operand and increment value.
4252 2007-06-07 Simon Martin <simartin@users.sourceforge.net>
4255 * decl.c (check_initializer): Report an error when a brace enclosed
4256 initializer is used for a non-aggregate type in C++98.
4257 (redeclaration_error_message): Rewrote flag_cpp0x in terms of
4259 (grokdeclarator): Likewise.
4260 (move_fn_p): Likewise.
4261 * typeck.c (check_return_expr): Likewise.
4262 * call.c (reference_binding): Likewise.
4263 * error.c (cp_cpp_error): Likewise.
4264 * pt.c (check_default_tmpl_args): Likewise.
4266 * lex.c (init_reswords): Likewise.
4267 * parser.c (p_parser_primary_expression): Likewise.
4268 (TOKEN_PRECEDENCE): Likewise.
4269 (cp_parser_init_declarator): Likewise.
4270 (cp_parser_ptr_operator): Likewise.
4271 (cp_parser_parameter_declaration): Likewise.
4272 (cp_parser_enclosed_template_argument_list): Likewise.
4273 (cp_parser_skip_to_end_of_template_parameter_list): Likewise.
4274 (cp_parser_next_token_ends_template_argument_p): Likewise.
4276 2007-06-04 Simon Baldwin <simonb@google.com>
4278 * decl.c (grokdeclarator): Readability change. Moved case labels
4279 into direct switch statement scope.
4281 2007-06-04 Paolo Carlini <pcarlini@suse.de>
4283 * call.c (convert_like_real): Remove pointless code.
4285 2007-05-31 Mark Mitchell <mark@codesourcery.com>
4287 * decl.c (get_atexit_fn_ptr_type): New function.
4288 (get_atexit_node): Use it.
4289 (start_cleanup_fn): Likewise.
4290 (register_dtor_fn): Use the object's destructor, instead of a
4291 separate cleanup function, where possible.
4292 * cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
4293 (atexit_fn_ptr_type_node): New macro.
4294 * decl2.c (build_cleanup): Use build_address.
4296 2007-05-31 Daniel Berlin <dberlin@dberlin.org>
4298 * typeck.c (build_binary_op): Include types in error.
4300 2007-05-31 Jakub Jelinek <jakub@redhat.com>
4303 * decl.c (cp_finish_decl): Also clear was_readonly if a static var
4304 needs runtime initialization.
4306 2007-05-31 Paolo Carlini <pcarlini@suse.de>
4309 * semantics.c (finish_trait_expr): Complete the types.
4311 2007-05-30 Russell Yanofsky <russ@yanofsky.org>
4312 Douglas Gregor <doug.gregor@gmail.com>
4313 Pedro Lamarao <pedro.lamarao@mndfck.org>
4314 Howard Hinnant <howard.hinnant@gmail.com>
4318 * typeck.c (comptypes): Don't consider rvalue and lvalue
4319 reference types to be equivalent.
4320 (check_return_expr): Move from certain lvalues when returning
4322 * decl.c (grokdeclarator): Implement reference collapsing.
4323 (copy_fn_p): Don't consider constructors taking rvalue references
4324 to be copy constructors.
4326 * call.c (conversion): New "rvaluedness_matches_p" member.
4327 (convert_class_to_reference): Require reference type as first
4328 parameter instead of base type.
4329 (reference_binding): Add logic to handle rvalue references.
4330 (implicit_conversion): Update inaccurate comment.
4331 (convert_like_real): Disable creation of temporaries that are
4332 impossible to initialize for types with move constructors.
4333 (build_over_call): Elide move constructors when possible.
4334 (maybe_handle_implicit_object): Set "rvaluedness_matches_p".
4335 (maybe_handle_ref_bind): Return conversion instead of type node.
4336 (compare_ics): Add logic to use "rvaluedness_matches_p" values to
4337 determine preferred conversion sequences.
4338 * cp-tree.h (TYPE_REF_IS_RVALUE): New.
4339 (LOOKUP_PREFER_RVALUE): New.
4340 (DECL_MOVE_CONSTRUCTOR_P): New.
4341 (struct cp_declarator): Add "reference" member for reference
4342 types, with new "rvalue_ref" flag.
4343 (cp_build_reference_type): Declare.
4344 (move_fn_p): Declare.
4345 * error.c (dump_type_prefix): Format rvalue reference types
4346 correctly in error messages.
4347 * except.c (build_throw): Move from certain lvalues when
4349 * mangle.c (write_type): Mangle rvalue references differently
4350 than regular references.
4351 * parser.c (make_reference_declarator): Add boolean parameter for
4353 (cp_parser_make_indirect_declarator): New.
4354 (cp_parser_new_declarator_opt): Call
4355 cp_parser_make_indirect_declarator.
4356 (cp_parser_conversion_declarator_opt): Ditto.
4357 (cp_parser_declarator): Ditto.
4358 (cp_parser_ptr_operator): Parse "&&" tokens into rvalue reference
4360 * pt.c (tsubst): Implement reference collapsing.
4361 (maybe_adjust_types_for_deduction): Implement special template
4362 parameter deduction rule for rvalue references.
4363 (type_unification_real): Update calls to
4364 maybe_adjust_types_for_deduction.
4365 (try_one_overload): Ditto.
4366 (unify_pack_expansion): Ditto.
4367 * tree.c (lvalue_p_1): Handle rvalue reference types.
4368 (cp_build_reference_type): New.
4370 2007-05-30 Jakub Jelinek <jakub@redhat.com>
4373 * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC
4374 variables that need runtime initialization.
4376 2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
4379 * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
4380 case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
4381 case POSTDECREMENT_EXPR>): Return the error_mark_node
4382 if either the real or imaginary parts would an
4385 2007-05-25 Simon Martin <simartin@users.sourceforge.net>
4386 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4389 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next
4390 token is a closing brace, false if there are no tokens left.
4391 (cp_parser_namespace_alias_definition): Only consume the next token if
4392 it is a closing brace.
4394 * parser.c (cp_parser_class_specifier): Likewise.
4396 2007-05-25 H.J. Lu <hongjiu.lu@intel.com>
4398 * semantics.c (finish_member_declaration): Fix a typo in the
4401 2007-05-25 Douglas Gregor <doug.gregor@gmail.com>
4413 * error.c (dump_type): Dump TYPE_ARGUMENT_PACK nodes.
4414 * cp-tree.h (check_for_bare_parameter_packs): Returns bool.
4415 * pt.c (check_for_bare_parameter_packs): Return bool indicated
4416 whether everything was okay. Fix indentation.
4417 (push_template_decl_real): Check for bare parameter packs in
4418 function parameters; where errors occur, mark the parameter types
4419 with ERROR_MARK_NODEs to avert ICEs.
4420 (coerce_template_parameter_pack): New.
4421 (coerce_template_parms): Moved parameter pack coercion into
4422 coerce_template_parameter_pack, and permit it anywhere in the
4423 template parameter list (not just at the end). Parameter and
4424 argument indices can vary (somewhat) separately now, so add
4425 PARM_IDX and ARG_IDX.
4426 (fn_type_unification): Don't set an argument pack as incomplete if
4427 no argument pack was deduced.
4428 (type_unification_real): If a type parameter is a parameter pack
4429 and has not otherwise been deduced, it will be deduced to an empty
4431 (more_specialized_fn): Use the actual lengths of the argument
4432 lists when comparing against expansions.
4433 * semantics.c (finish_member_declaration): If a field's type has
4434 bare parameter packs, error and set its type to ERROR_MARK_NODE.
4436 2007-05-24 Danny Smith <dannysmith@users.sourceforge.net>
4439 * mangle.c (mangle_decl): Call targetm.mangle_decl_assembler_name.
4441 2007-05-22 Ollie Wild <aaw@google.com>
4443 * name-lookup.c (ambiguous_decl): Adds check for hidden types.
4444 (unqualified_namespace_lookup): Adds check for hidden types.
4446 2007-05-22 Ollie Wild <aaw@google.com>
4448 * decl.c (duplicate_decls): Verify namespace names are unique.
4450 2007-05-21 Mark Mitchell <mark@codesourcery.com>
4452 * decl.c (cxx_maybe_build_cleanup): Handle
4453 __attribute__((cleanup)).
4455 2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4457 * cvt.c (cp_convert_and_check): Don't check warnings if the
4460 2007-05-18 Geoffrey Keating <geoffk@apple.com>
4462 * mangle.c (write_real_cst): Use 'unsigned long' for %lx.
4464 2007-05-14 Paolo Carlini <pcarlini@suse.de>
4467 * rtti.c (get_tinfo_decl_dynamic, get_typeid): Try to complete the
4468 type only if is a class type (5.2.8/4).
4470 2007-05-14 Rafael Avila de Espindola <espindola@google.com>
4472 * cp-objcp-common.h (LANG_HOOKS_UNSIGNED_TYPE): Remove.
4473 * decl.c (grokdeclarator): Use unsigned_type_for instead of
4474 c_common_unsigned_type.
4476 2007-05-11 Silvius Rus <rus@google.com>
4478 * typeck.c (build_indirect_ref): Add call to
4479 strict_aliasing_warning.
4480 (build_reinterpret_cast_1): Condition call to
4481 strict_aliasing_warning.
4483 2007-05-11 Jan Hubicka <jh@suse.cz>
4485 * semantics.c (expand_or_defer_fn): Do not call c_record_cdtor_fn.
4486 * decl2.c (start_objects): ctors and dtors are no longer public.
4487 (cp_write_global_declarations): Do not call c_build_cdtor_fns.
4489 2007-05-07 Andrew Pinski <andrew_pinski@playstation.sony.com>
4491 * typeck.c (build_unary_op): Remove code that used to
4492 handle non lvalue increments/decrements.
4494 2007-05-07 Mike Stump <mrs@apple.com>
4496 * parser.c (check_empty_body): Add.
4497 (cp_parser_iteration_statement): Add call to check_empty_body.
4499 2007-05-05 Geoffrey Keating <geoffk@apple.com>
4502 * mangle.c (write_mangled_name): Mangle static variable names.
4503 (write_unqualified_name): Use local-source-name for
4504 namespace-scope static variables.
4506 2007-05-04 Dirk Mueller <dmueller@suse.de>
4508 * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is
4511 2007-05-02 Seongbae Park <seongbae.park@gmail.com>
4514 * decl2.c (constrain_class_visibility):
4515 Use strip_pointer_or_array_types instead of strip_array_types.
4517 2007-04-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
4520 * decl.c (reshape_init_r): Don't reshape the first element if it
4521 is a pointer to member function.
4523 2007-04-27 Simon Baldwin <simonb@google.com>
4525 * decl.c (grokparms): Changed message format from %qD to %qE.
4527 2007-04-27 Douglas Gregor <doug.gregor@gmail.com>
4529 * error.c (maybe_warn_variadic_templates): Variadic templates are
4530 now in C++0x, so only warn about them in C++98 mode.
4532 2007-04-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
4535 * typeck.c (build_reinterpret_cast_1): Only allow conversion to
4536 integeral types from vectors types.
4538 2007-04-26 Jakub Jelinek <jakub@redhat.com>
4541 * semantics.c (finish_omp_clauses): Don't create CP_OMP_CLAUSE_INFO
4542 for type dependent OMP_CLAUSE_DECLs.
4544 2007-04-24 Mark Mitchell <mark@codesourcery.com>
4547 * cp-tree.h (ARITHMETIC_TYPE): Include COMPLEX_TYPE.
4548 * typeck.c (type_after_usual_arithmetic_conversions): Adjust, as
4549 COMPLEX_TYPE is now an ARITHMETIC_TYPE.
4550 * init.c (build_zero_init): Adjust, as
4551 COMPLEX_TYPE is now a SCALAR_TYPE.
4552 * typeck2.c (digest_init): Allow brace-enclosed initializers for
4553 COMPLEX_TYPE, even though that is now a SCALAR_TYPE.
4555 2007-04-25 Paolo Carlini <pcarlini@suse.de>
4557 * semantics.c (classtype_has_nothrow_copy_or_assign_p): Adjust
4558 per N2255; rename as classtype_has_nothrow_assign_or_copy_p.
4559 (trait_expr_value): Adjust.
4561 2007-04-23 Simon Baldwin <simonb@google.com>
4563 * decl.c (grokparms): Added new error for duplicate function
4564 parameters names in function prototypes, to match gcc behavior.
4566 2007-04-23 Jan Hubicka <jh@suse.cz>
4568 * decl2.c (finish_objects): Do not call target constructor/destructor
4571 2007-04-21 Andrew Pinski <andrew_pinski@playstation.sony.com>
4573 * cp-tree.h (lang_tree_node): Use GENERIC_NEXT
4574 instead of checking GIMPLE_STMT_P in chain_next.
4576 2007-04-17 Mark Mitchell <mark@codesourcery.com>
4579 * call.c (convert_for_arg_passing): Convert bitfields to their
4582 2007-04-17 Simon Martin <simartin@users.sourceforge.net>
4585 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
4587 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
4590 * decl2.c (constrain_class_visibility):
4591 Do not warn about the use of anonymous namespace in the main input file.
4593 2007-04-15 Mark Mitchell <mark@codesourcery.com>
4595 * cp-tree.h (current_template_parms): Fix typo in comment.
4597 2007-04-15 Kazu Hirata <kazu@codesourcery.com>
4599 * cp-tree.h, error.c: Fix comment typos.
4601 2007-04-13 Jason Merrill <jason@redhat.com>
4604 * call.c (reference_binding): Add c_cast_p parm. If true,
4605 add quals to TO as needed to make it reference-compatible.
4607 2007-04-11 Jan Hubicka <jh@suse.cz>
4609 * class.c (convert_to_base_statically): Fold produced tree; verify
4610 that we are not processing template_decl.
4612 2007-04-09 Mark Mitchell <mark@codesourcery.com>
4615 * class.c (build_base_path): Ensure that the converted pointer has
4616 the same cv-qualification as the input.
4618 2007-04-09 Paolo Carlini <pcarlini@suse.de>
4620 * tree.c (cp_tree_equal): Deal with TRAIT_EXPR.
4622 2007-04-08 Steven Bosscher <steven@gcc.gnu.org>
4624 * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS):
4626 (LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P): Do not set it.
4627 * tree.c (cp_add_pending_fn_decls): Remove.
4628 * cp-tree.h (cp_add_pending_fn_decls): Remove prototype.
4630 2007-04-07 Daniel Berlin <dberlin@dberlin.org>
4632 Revert change removing staticp.
4634 2007-04-06 Daniel Berlin <dberlin@dberlin.org>
4636 * cp-objcp-common.c (cxx_staticp): Remove.
4637 * cp-objcp-common.h (LANG_HOOKS_STATICP): Remove.
4638 * cp-tree.h (cxx_staticp):
4640 2007-04-04 Danny Smith <dannysmith.users.sourceforge.net>
4642 * class.c (check_for_override): Don't remove dllmport attribute
4645 2007-04-03 Jakub Jelinek <jakub@redhat.com>
4648 * typeck.c (build_modify_expr): For COND_EXPR on LHS, if RHS has void
4649 type issue error and return early.
4651 2007-03-30 Jason Merrill <jason@redhat.com>
4654 * typeck.c (cp_type_readonly): New fn.
4655 * cp-tree.h: Declare it.
4656 * decl.c (start_decl): Set implicit DECL_THIS_STATIC here.
4657 (cp_finish_decl): Not here.
4659 2007-03-31 Richard Guenther <rguenther@suse.de>
4661 * optimize.c (maybe_clone_body): Replace splay-tree usage by
4664 2007-03-31 Douglas Gregor <doug.gregor@gmail.com>
4669 * parser.c (declarator_can_be_parameter_pack): New.
4670 (cp_parser_template_parameter): Only parse the `...' if the
4671 declarator can be a parameter pack.
4672 (cp_parser_parameter_declaration): Ditto. Also, handle when TYPE
4674 * pt.c (find_parameter_packs_r): Look into the bounds on integer
4675 types (they could be used as array bounds).
4676 (check_for_bare_parameter_packs): Deal with TEMPLATE_PARM_INDEX.
4677 (tsubst_pack_expansion): Handle failure to expand parameter
4680 2007-03-30 Paolo Carlini <pcarlini@suse.de>
4683 * cp-tree.h (enum cp_trait_kind, struct tree_trait_expr,
4684 TRAIT_EXPR_TYPE1, TRAIT_EXPR_TYPE2, TRAIT_EXPR_KIND): Add.
4685 (enum cp_tree_node_structure_enum, union lang_tree_node): Update.
4686 (CLASS_TYPE_NON_UNION_P): Add.
4687 (struct lang_type_class): Add has_complex_dflt.
4688 (TYPE_HAS_COMPLEX_DFLT, TYPE_HAS_TRIVIAL_DFLT): Add.
4689 (locate_copy, locate_ctor, locate_dtor, finish_trait_expr): Declare.
4690 * cp-tree.def: Add TRAIT_EXPR.
4691 * cp-objcp-common.c (cp_tree_size): Add TRAIT_EXPR case.
4692 * lex.c (struct resword): Add __has_nothrow_assign,
4693 __has_nothrow_constructor, __has_nothrow_copy, __has_trivial_assign,
4694 __has_trivial_constructor, __has_trivial_copy,
4695 __has_trivial_destructor, __has_virtual_destructor, __is_abstract,
4696 __is_base_of, __is_class, __is_convertible_to, __is_empty, __is_enum,
4697 __is_pod, __is_polymorphic, __is_union.
4698 * parser.c (cp_parser_primary_expression): Deal with the new RIDs.
4699 (cp_parser_trait_expr): New.
4700 * semantics.c (finish_trait_expr, trait_expr_value
4701 classtype_has_nothrow_copy_or_assign_p): New.
4702 * method.c (locate_copy, locate_ctor, locate_dtor): Do not define
4704 * decl.c (cp_tree_node_structure): Add TRAIT_EXPR.
4705 * class.c (check_bases, check_field_decl, check_bases_and_members):
4706 Deal with TYPE_HAS_COMPLEX_DFLT (t) too.
4707 * pt.c (uses_template_parms, tsubst_copy_and_build,
4708 value_dependent_expression_p, type_dependent_expression_p): Deal with
4710 * tree.c (cp_walk_subtrees): Deal with TRAIT_EXPR.
4712 2007-03-29 Richard Guenther <rguenther@suse.de>
4714 * tree.c (cp_walk_subtrees): Do not set input_location.
4716 2007-03-28 Simon Martin <simartin@users.sourceforge.net>
4719 * decl.c (grokfndecl): Properly setup decl if it is a constructor or a
4722 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
4724 * parser.c (struct cp_parser): Update comment for
4725 greater_than_is_operator_p.
4726 (cp_parser_primary_expression): In C++0x mode, a cast operator can
4727 be terminated with a `>>' token when !GREATER_THAN_IS_OPERATOR_P.
4728 (TOKEN_PRECEDENCE): In C++0x mode, `>>' is treated like `>' when
4729 !GREATER_THAN_IS_OPERATOR_P.
4730 (cp_parser_binary_expression): When -Wc++0x-compat, warn about
4731 `>>' operators that will become two `>' tokens in C++0x.
4732 (cp_parser_parameter_declaration): Treat `>>' like `>' in C++0x
4733 mode, allowing it to terminate default arguments.
4734 (cp_parser_enclosed_template_argument_list): In C++0x mode, treat
4735 `>>' like two consecutive `>' tokens.
4736 (cp_parser_skip_to_end_of_template_parameter_list): Ditto.
4737 (cp_parser_next_token_ends_template_argument_p): In C++0x, `>>'
4738 ends a template argument.
4740 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
4742 * decl.c (redeclaration_error_message): Complain when redeclaring
4743 a friend function with default template arguments (C++0x mode only).
4744 * cp-tree.h (check_default_tmpl_args): Declare.
4745 * pt.c (check_default_tmpl_args): In C++0x mode, permit default
4746 template arguments in function templates. Add support for checking
4747 the default template arguments of friend templates.
4748 (push_template_decl_real): Fix call to check_default_tmpl_args.
4749 (type_unification_real): If a template parameter has not been
4750 deduced but provides a default template argument, substitute into
4751 that default template argument.
4752 * parser.c (cp_parser_init_declarator): When declaring (but not
4753 defining!) a function template in C++0x mode, check for default
4756 2007-03-28 Douglas Gregor <doug.gregor@gmail.com>
4759 * decl.c (grokdeclarator): Deal with cv-qualified function type
4760 typedefs in the same way for member and non-member functions.
4762 2007-03-26 Dirk Mueller <dmueller@suse.de>
4764 * parser.c (cp_parser_member_declaration): Pedwarn
4765 about stray semicolons after member declarations.
4767 2007-03-26 Paolo Carlini <pcarlini@suse.de>
4770 * pt.c (instantiate_decl): Set in_system_header.
4772 2007-03-22 Mark Mitchell <mark@codesourcery.com>
4774 * cp-tree.h (current_tempalte_parms): Improve documentation.
4775 * pt.c (current_template_args): Likewise.
4778 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Do
4779 not consume tokens when failing.
4781 2007-03-22 Jim Wilson <wilson@specifix.com>
4782 Mark Mitchell <mark@codesourcery.com>
4785 * call.c (standard_conversion): Use type_decays_to. Keep FCODE
4786 consistent with FROM.
4788 2007-03-22 Gabriel Dos Reis <gdr@integrable-solutions.net>
4790 * error.c (dump_expr): Handle dependent names that designate types.
4791 * cxx-pretty-print.c (pp_cxx_unqualified_id): Handle TYPENAME_TYPE.
4793 2007-03-17 Kazu Hirata <kazu@codesourcery.com>
4795 * cp-tree.def, parser.c, pt.c: Fix comment typos.
4797 2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4799 * cvt.c (cp_convert_and_check) : Define.
4800 * cp-tree.h (cp_convert_and_check): Declare.
4801 * call.c (convert_conversion_warnings): Rename to
4802 conversion_null_warnings. The warning for floating-point to
4803 integer is handled by convert_and_check in convert_like_real.
4804 (convert_like_real): convert_conversion_warnings was renamed as
4805 conversion_null_warnings.
4806 * typeck.c (build_binary_op): Use cp_convert_and_check to warn for
4807 overflow and changes of value during conversion.
4809 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4812 * parser.c (cp_parser_statement): If 'namespace' is found, this
4813 only can be a namespace alias definition, so parse it now.
4814 (cp_parser_namespace_alias_definition): if we find an open brace
4815 instead of '=', then this is actually a misplaced namespace
4818 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4821 * decl.c (cxx_init_decl_processing): Move command-line options
4822 processing to c-opts.c.
4824 2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
4826 * ptree.c (cxx_print_type): Use formatting markup for integers
4827 when printing template parameter index/level/orig level.
4828 (cxx_print_xnode): Ditto.
4829 * cp-tree.h (TEMPLATE_PARM_PARAMETER_PACK): Use TREE_LANG_FLAG_0.
4830 (struct template_parm_index_s): Remove the PARAMETER_PACK member.
4831 Make INDEX, LEVEL, and ORIG_LEVEL integers instead of
4833 (struct saved_scope): Make X_PROCESSING_TEMPLATE_DECL an int,
4834 rather than a HOST_WIDE_INT.
4835 Turn X_PROCESSING_EXPLICIT_INSTANTIATION, SKIP_EVALUATION, and
4836 NEED_POP_FUNCTION_CONTEXT into bool bitfields; reorder fields for
4838 (struct language_function): Make RETURNS_VALUE, RETURNS_NULL,
4839 RETURNS_ABNORMALLY, IN_FUNCTION_TRY_HANDLER, and
4840 IN_BASE_INITIALIZER bool bitfields.
4841 (struct cp_declarator): Make KIND a 4-bit field. Make
4842 PARAMETER_PACK_P a bool bitfield just after KIND.
4843 * pt.c (uses_parameter_packs): Destroy the pointer set.
4844 (make_pack_expansion): Ditto.
4845 (check_for_bare_parameter_packs): Ditto.
4846 * name-lookup.c (push_to_top_level): Make need_pop a bool value.
4848 2007-03-14 Andrew Pinski <andrew_pinski@playstation.sony.com>
4851 * call.c (convert_default_arg): Instead of copying the node,
4854 2007-03-15 Dirk Mueller <dmueller@suse.de>
4857 * call.c (convert_conversion_warnings): New..
4858 (convert_like_real): .. factored out from here.
4859 (convert_conversion_warnings): Add warning about
4860 false being converted to NULL in argument passing.
4862 2007-03-14 Dirk Mueller <dmueller@suse.de>
4864 * semantics.c (c_finish_if_stmt): Call empty_if_body_warning.
4865 (finish_do_body): Warn about empty body in do/while statement.
4867 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4869 * class.c (warn_hidden): Add OPT_Woverloaded_virtual to warning.
4871 2007-03-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
4874 * typeck.c (build_binary_op): Call warn_for_div_zero instead of
4877 2007-03-13 Alexandre Oliva <aoliva@redhat.com>
4879 * repo.c (init_repo): Initialize random_seed saved options.
4880 (finish_repo): Adjust.
4882 2007-03-13 Mark Mitchell <mark@codesourcery.com>
4885 * Make-lang.in (doc/g++.1): Use $< to specify the location from
4888 2007-03-12 Seongbae Park <seongbae.park@gmail.com>
4890 * decl.c (compute_array_index_type): New warning flag warn_vla.
4892 2007-03-12 Mark Mitchell <mark@codesourcery.com>
4895 * call.c (convert_default_arg): Copy non-constant arguments.
4897 2007-03-11 Mark Mitchell <mark@codesourcery.com>
4900 * parser.c (cp_parser_postfix_expression): Disallow compound
4901 literals in constant expressions.
4904 * semantics.c (finish_typeof): Use unlowered_expr_type.
4906 2007-03-10 Mark Mitchell <mark@codesourcery.com>
4909 * cp-tree.h (unlowered_expr_type): New function.
4910 * typeck.c (is_bitfield_expr_with_lowered_type): Handle
4911 COMPOUND_EXPR, MODIFY_EXPR, and SAVE_EXPR.
4912 (unlowered_expr_type): New function.
4913 (build_unary_op): Disallow predecrements of bool bitfields.
4914 * call.c (build_conditional_expr): Use unlowered_expr_type.
4915 * pt.c (type_unification_real): Likewise.
4917 2007-03-09 Douglas Gregor <doug.gregor@gmail.com>
4920 * typeck.c (check_return_expr): Check for bare parameter packs.
4921 (comptypes): Compare template parameter packs and
4922 type pack expansions.
4923 * decl.c (grokdeclarator): Deal with the declaration of function
4925 (grokparms): Verify that the (optional) function parameter pack is
4926 at the end of the parameter list.
4927 (xref_basetypes): Handle pack expansions in the base class.
4928 (cp_tree_node_structure): Handle ARGUMENT_PACK_SELECT.
4929 * cp-tree.def (TYPE_ARGUMENT_PACK): New.
4930 (NONTYPE_ARGUMENT_PACK): New.
4931 (TYPE_PACK_EXPANSION): New.
4932 (EXPR_PACK_EXPANSION): New.
4933 (ARGUMENT_PACK_SELECT): New.
4934 * cp-objcp-common.c (cp_tree_size): Compute size of
4935 (NON)TYPE_ARGUMENT_PACK, (TYPE|EXPR)_PACK_EXPANSION, and
4936 ARGUMENT_PACK_SELECT.
4937 * error.c (dump_template_argument): Print template argument packs.
4938 (dump_template_argument_list): Ditto.
4939 (dump_template_parameter): Dump `...' for template type parameter
4941 (dump_type): Dump TYPE_PACK_EXPANSION nodes.
4942 (dump_parameters): Print function parameter packs.
4943 (dump_template_parms): Print template argument packs.
4944 (dump_expr): Dump EXPR_PACK_EXPANSION nodes.
4945 (maybe_warn_variadic_templates): New.
4946 * operators.def: Add ellipsis operator for EXPR_PACK_EXPANSION.
4947 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
4948 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
4950 * mangle.c (write_type): Mangle TYPE_PACK_EXPANSION.
4951 (write_template_arg): Write argument packs as separate arguments.
4952 * cp-tree.h (struct template_parm_index_s): Add flag that
4953 indicates that the template parameter is actually a parameter
4955 (struct tree_argument_pack_select): New.
4956 (enum cp_tree_node_structure_enum): Add TS_CP_ARGUMENT_PACK_SELECT.
4957 (union lang_tree_node): Add argument_pack_select.
4958 (FUNCTION_PARAMETER_PACK_P): New.
4959 (PACK_EXPANSION_P): New.
4960 (PACK_EXPANSION_PATTERN): New.
4961 (SET_PACK_EXPANSION_PATTERN): New.
4962 (PACK_EXPANSION_PARAMETER_PACKS): New.
4963 (ARGUMENT_PACK_P): New.
4964 (ARGUMENT_PACK_ARGS): New.
4965 (SET_ARGUMENT_PACK_ARGS): New.
4966 (ARGUMENT_PACK_INCOMPLETE_P): New.
4967 (ARGUMENT_PACK_EXPLICIT_ARGS): New.
4968 (TEMPLATE_PARM_PARAMETER_PACK): New.
4969 (TEMPLATE_TYPE_PARAMETER_PACK): New.
4970 (ARGUMENT_PACK_SELECT_FROM_PACK): New.
4971 (ARGUMENT_PACK_SELECT_INDEX): New.
4972 (ARGUMENT_PACK_SELECT_ARG): New.
4973 (struct cp_declarator): Add parameter_pack_p flag.
4974 (maybe_warn_variadic_templates): Declare.
4975 (process_template_parm): Add bool parameter IS_PARAMETER_PACK, to
4976 indicate a template parameter pack.
4977 (uses_parameter_packs): Declare.
4978 (template_parameter_pack_p): Declare.
4979 (template_parms_variadic_p): Declare.
4980 (make_pack_expansion): Declare.
4981 (check_for_bare_parameter_packs): Declare.
4982 * cxx-pretty-print.c (pp_cxx_unary_expression): Print
4983 sizeof... expressions.
4984 (pp_cxx_expression): Print pack expansions and non-type argument
4986 (pp_cxx_exception_specification): Print pack expansions.
4987 (pp_cxx_direct_declarator): Print ellipsis for parameter packs.
4988 (pp_cxx_ctor_initializer): Print pack expansions.
4989 (pp_cxx_type_id): Print pack expansions.
4990 (pp_cxx_template_argument_list): Print argument packs.
4991 (pp_cxx_template_parameter): Print ellipsis for template parameter
4993 * pt.c (comp_template_parms): Compare template parameter packs.
4994 (template_parameter_pack_p): New.
4995 (template_parms_variadic_p): New.
4996 (template_args_variadic_p): New.
4997 (make_ith_pack_parameter_name): New.
4998 (struct find_parameter_pack_data): New.
4999 (find_parameter_packs_r): New.
5000 (uses_parameter_packs): New.
5001 (make_pack_expansion): New.
5002 (check_for_bare_parameter_packs): New.
5003 (expand_template_argument_pack): New.
5004 (reduce_template_parm_level): Propagate parameter pack flag.
5005 (process_template_parm): Add is_parameter_pack parameter to state
5006 when the parameter is actually a parameter pack. Create template
5007 parameter packs when is_parameter_pack is true.
5008 (current_template_args): The argument for a template parameter
5009 pack is an argument pack containing a single pack expansion.
5010 (process_partial_specialization): When checking that non-type
5011 argument expressions do not involve template parameters, loop over
5012 the arguments in argument packs separately.
5013 (push_template_decl_real): Check that the type of the declaration
5014 does not have any bare parameter packs. Check that primary
5015 templates have no more than one parameter pack, and that it comes
5016 at the end of the template parameter list.
5017 (convert_template_argument): Handle coercions for pack expansion
5018 expressions by coercing the pattern then rebuilding the expansion.
5019 (coerce_template_parms): When coercing the arguments for a
5020 variadic template, pack "extra" arguments into an argument pack.
5021 (coerce_template_template_parms): Cannot coerce between parameter
5022 packs and non-pack parameters.
5023 (template_args_equal): Compare PACK_EXPANSION_P expressions.
5024 (comp_template_args): Expand all template arguments packs before
5025 comparing template argument lists.
5026 (mangle_class_name_for_template): Make argument packs as separate
5028 (for_each_template_parm_r): No need to handle BASELINK.
5029 (instantiate_class_template): Handle pack expansions in the base
5031 (tsubst_pack_expansion): New.
5032 (tsubst_template_args): Handle substitutions of argument packs and
5033 pack expansion into template argument lists.
5034 (tsubst_decl): Expand function parameter packs into separate
5035 function parameters.
5036 (tsubst_arg_types): Expand a type pack expansion into separate
5038 (tsubst_exception_specification): Handle pack expansions in
5039 exception specifiers.
5040 (tsubst): See through ARGUMENT_PACK_SELECT arguments when
5041 replacing a template parameter with its argument. If we encounter
5042 a substitution for an argument pack, just return the parameter
5044 (tsubst_copy): sizeof(X...) returns the number of elements in
5045 parameter pack X. See through ARGUMENT_PACK_SELECT when the
5046 PARM_DECL is a parameter pack.
5047 (tsubst_expr): Expression pack expansions and argument packs
5048 cannot show up here; they will all be handled through function
5049 calls, sizeof, and template argument lists.
5050 (tsubst_copy_and_build): sizeof(X...) returns the number of
5051 elements in parameter pack X. Handle pack expansions in TREE_LIST
5052 and CONSTRUCTOR nodes.
5053 (fn_type_unification): Handle "incomplete" explicit template
5054 argument lists that specify some of the arguments for a template
5056 (type_unification_real): Unify arguments against pack expansions.
5057 (template_parm_level_and_index): New, helper function.
5058 (unify_pack_expansion): New.
5059 (unify): Unify argument packs on an argument-by-argument basis,
5060 handling variadic argument packs as well.
5061 (more_specialized_fn): Handle unification of function parameter
5062 packs. All things being equal, prefer non-variadic function
5063 templates to variadic function templates.
5064 (more_specialized_class): Prefer the variadic class template
5065 partial specialization that binds fewer arguments to a parameter
5067 (regenerate_decl_from_template): Expand function parameter packs
5068 into separate parameters.
5069 (instantiate_decl): Ditto.
5070 (tsubst_initializer_list): Handle pack expansions for base-class
5072 (dependent_type_p_r): Determine dependent types in argument packs
5073 and pack expansions.
5074 (value_dependent_expression_p): Determine value-dependence of
5075 non-type argument packs.
5076 (dependent_template_arg_p): Handle argument packs.
5077 * semantics.c (finish_cond): Check for bare parameter packs.
5078 (finish_expr_stmt): Ditto.
5079 (finish_for_expr): Ditto.
5080 (finish_switch_cond): Ditto.
5081 (finish_mem_initializers): Ditto.
5082 * name-lookup.c (arg_assoc_type): Handle pack expansions and
5084 * decl2.c (cp_build_parm_decl): Mark function parameter packs.
5085 * parser.c (make_declarator): Declarator is not an expansion.
5086 (make_pointer_declarator): Transfer parameter pack flag to outer
5088 (make_reference_declarator): Ditto.
5089 (make_ptrmem_declarator): Ditto.
5090 (make_call_declarator): Ditto.
5091 (make_array_declarator): Ditto.
5092 (cp_parser_postfix_expression): Allow pack expansion expressions
5093 in the argument list for a call expression.
5094 (cp_parser_parenthesized_expression_list): Add new parameter
5095 ALLOW_EXPANSION_P. When true, parse the ellipsis to mean "expand
5096 into separate arguments."
5097 (cp_parser_new_placement): Allow pack expansion expressions.
5098 (cp_parser_new_initializer): Ditto.
5099 (cp_parser_mem_initializer_list): Allow ellipsis to create a
5100 base-class initializer expansion.
5101 (cp_parser_mem_initializer): Ditto.
5102 (cp_parser_template_parameter_list): Keep track of whether the
5103 template parameter is a template parameter pack.
5104 (cp_parser_template_parameter): Parse the ellipsis to indicate a
5105 template parameter pack.
5106 (cp_parser_type_parameter): Ditto.
5107 (cp_parser_template_argument_list): Parse the ellipsis to indicate
5109 (cp_parser_direct_declarator): Parse the ellipsis to indicate that
5110 this declarator is a parameter pack.
5111 (cp_parser_parameter_declaration): The ellipsis does not end the
5112 parameter declaration, because it might be a parameter pack. Parse
5113 the ellipsis to indicate a parameter pack.
5114 (cp_parser_initializer): Allow pack expansions.
5115 (cp_parser_initializer_list): Allow ellipsis to create an
5116 initializer expansion.
5117 (cp_parser_base_clause): Allow ellipsis to create a base specifier
5119 (cp_parser_type_id_list): Allow ellipsis to create an exception
5120 specifier expansion.
5121 (cp_parser_attribute_list): Don't allow pack expansions.
5122 (cp_parser_functional_cast): Allow pack expansions.
5123 (cp_parser_sizeof_operand): Allow ellipsis following "sizeof" to
5124 compute the length of a parameter pack.
5125 (cp_parser_next_token_ends_template_argument_p): An ellipsis can
5126 end a template argument.
5127 * tree.c (cp_walk_subtrees): Walk BASELINK, TYPE_ARGUMENT_PACK,
5128 NONTYPE_ARGUMENT_PACK, TYPE_PACK_EXPANSION, EXPR_PACK_EXPANSION,
5131 2007-03-09 Dirk Mueller <dmueller@suse.de>
5133 * call.c (build_new_op): Call warn_logical_operator.
5135 2007-03-08 Volker Reichelt <reichelt@netcologne.de>
5138 * semantics.c (finish_offsetof): Handle COMPOUND_EXPR.
5141 * pt.c (any_template_arguments_need_structural_equality_p):
5144 2007-03-08 Alexandre Oliva <aoliva@redhat.com>
5146 * decl.c (grokdeclarator): Disable warnings for anonymous
5149 2007-03-05 Volker Reichelt <reichelt@netcologne.de>
5151 * typeck2.c (readonly_error): Always emit a hard error.
5152 Remove last argument.
5153 * cp-tree.h (readonly_error): Adjust prototype.
5154 * semantics.c (finish_asm_stmt): Adjust call to readonly_error.
5155 * typeck.c (build_unary_op): Likewise.
5156 (build_modify_expr): Likewise.
5158 2007-03-04 Simon Martin <simartin@users.sourceforge.net>
5161 * tree.c (cp_tree_equal): Properly handle COMPLEX_CST trees.
5163 2007-03-03 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5166 * parser.c (struct cp_parser): New IN_IF_STMT.
5167 (cp_parser_statement_seq_opt): Handle an unexpected 'else',
5168 returning if parsing the body of an 'if' statement or issuing an
5169 error and continuing.
5170 (cp_parser_selection_statement): Set IN_IF_STMT bit when parsing
5172 (cp_parser_jump_statement): Mask new IN_IF_STMT bit.
5174 2007-03-02 Simon Martin <simartin@users.sourceforge.net>
5177 * class.c (update_vtable_entry_for_fn): Properly handle invalid overriders
5180 2007-03-02 Geoffrey Keating <geoffk@apple.com>
5182 * g++spec.c (lang_specific_driver): Add -lstdc++ when compiling
5183 Objective-C++. Don't exit early if -shared-libgcc needs to be
5186 2007-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5188 * typeck.c (common_base_type): Delete unused function.
5190 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
5192 * Make-lang.in: Add dummy lang.install-pdf target.
5194 2007-03-01 Simon Baldwin <simonb@google.com>
5197 * decl.c (check_tag_decl): Added new warning for typedef ignored
5198 when it precedes an otherwise valid non-typedef declaration.
5200 2007-02-28 Sandra Loosemore <sandra@codesourcery.com>
5202 * typeck.c (build_function_call): Store converted arguments
5203 in a stack-allocated array instead of building a list.
5204 (convert_arguments): Store arguments in the array passed in as an
5205 argument, and return the actual number of arguments.
5206 * call.c (build_call): Delete, and replace with...
5207 (build_call_n, build_call_a): New.
5208 (build_op_delete_call): Rewrite to avoid constructing argument lists.
5209 (build_over_call): Store converted arguments in a stack-allocated
5210 array instead of building a list.
5211 (build_cxx_call): Pass arguments in an array instead of as a list.
5212 (build_java_interface_fn_ref): Rewrite to avoid constructing
5214 * tree.h: Update declarations to reflect above changes.
5215 * method.c (use_thunk): Use a stack-allocated array to hold
5216 the arguments instead of a list.
5217 * rtti.c (throw_bad_cast): Update call to cxx_call.
5218 (throw_bad_typeid): Likewise.
5219 (build_dynamic_cast_1): Likewise.
5220 * init.c (build_builtin_delete_call): Use build_call_n.
5221 * decl.c (expand_static_init): Likewise.
5222 * except.c (cp_protect_cleanup_actions): Likewise.
5223 * cp-gimplify.c (genericize_eh_spec_block): Likewise.
5224 (gimplify_must_not_throw_expr): Likewise.
5225 (cxx_omp_apply_fn): Use build_call_a.
5227 2007-02-26 Mark Mitchell <mark@codesourcery.com>
5229 * semantics.c (expand_or_defer_fn): Call c_record_cdtor_fn.
5230 * decl2.c (cp_write_gloabl_declarations): Call c_build_cdtor_fns.
5232 2007-02-25 Mark Mitchell <mark@codesourcery.com>
5234 * cp-tree.h (static_ctors): Remove.
5235 * cp-tree.h (static_dtors): Likewise.
5236 * cp-objcp-common.c (decl_shadowed_for_var_lookup): Adjust for
5237 refactoring of tree_map hierarchy.
5238 (decl_shadowed_for_var_insert): Likewise.
5239 * semantics.c (expand_body): Use c_expand_body.
5240 (expand_or_defer_fn): Don't update static_ctors or static_dtors.
5241 * decl2.c (static_ctors): Remove.
5242 (static_dtors): Likewise.
5243 (generate_ctor_or_dtor_function): Pass NULL_TREE to
5244 objc_generate_static_init_call. Do not call static_[cd]tors.
5245 (generate_ctor_and_dtor_functions_for_priority): Do not check for
5247 (cp_write_global_declarations): Likewise.
5249 2007-02-23 Richard Guenther <rguenther@suse.de>
5251 * class.c (note_name_declared_in_class): Make declaration
5252 changes meaning a pedwarn.
5254 2007-02-22 Michael Matz <matz@suse.de>
5257 * cp-tree.h (TFF_UNQUALIFIED_NAME): New formatting flag.
5258 * error.c (dump_aggr_type, dump_simple_decl, dump_decl,
5259 dump_function_decl): Guard emitting outer scopes by new flag.
5260 * cp-lang.c (cxx_dwarf_name): New function.
5261 (LANG_HOOKS_DWARF_NAME): Define to cxx_dwarf_name.
5262 * pt.c (classtype_mangled_name, mangle_class_name_for_template):
5264 (push_template_decl_real, lookup_template_class): Remove calls
5267 2007-02-19 Mark Mitchell <mark@codesourcery.com>
5269 * call.c (build_new_method_call): Ensure that explicit calls of
5270 destructors have type "void".
5272 2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5274 * typeck.c (build_binary_op): Replace -Wstring-literal-comparison
5275 and -Walways-true with -Waddress.
5276 * cvt.c (convert_to_void): Replace unconditional warning with
5279 2007-02-18 Kazu Hirata <kazu@codesourcery.com>
5281 * decl.c, tree.c: Fix comment typos.
5283 2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
5286 * semantics.c (finish_stmt_expr_expr): Set TREE_TYPE of the
5287 statement expression if we had an error mark node.
5289 2007-02-15 Sandra Loosemore <sandra@codesourcery.com>
5290 Brooks Moses <brooks.moses@codesourcery.com>
5291 Lee Millward <lee.millward@codesourcery.com>
5293 * cp-tree.def (AGGR_INIT_EXPR): Adjust documentation.
5294 Change class to tcc_vl_exp.
5296 * call.c (build_call): Use build_call_list instead
5298 (build_over_call): Likewise.
5299 (build_new_method_call): Use build_min_non_dep_call_list
5300 instead of build_min_non_dep.
5302 * error.c (dump_call_expr_args): New function.
5303 (dump_aggr_init_expr_args): New function.
5304 (dump_expr) <AGGR_INIT_EXPR, CALL_EXPR, INDIRECT_REF>: Use them.
5305 Update to use new CALL_EXPR and AGGR_INIT_EXPR accessor macros.
5307 * cvt.c (convert_to_void): Use build_call_array instead
5308 of build3; use new AGGR_INIT_EXPR accessor macros.
5310 * mangle.c (write_expression): Use TREE_OPERAND_LENGTH
5311 instead of TREE_CODE_LENGTH.
5313 * dump.c (cp_dump_tree) <AGGR_INIT_EXPR>: Update to use new
5314 AGGR_INIT_EXPR accessor macros.
5316 * cp-gimplify.c (cp_gimplify_init_expr): Use
5317 AGGR_INIT_EXPR_SLOT to set the slot operand.
5319 * cp-tree.h (AGGR_INIT_EXPR_FN): New macro.
5320 (AGGR_INIT_EXPR_SLOT): New macro.
5321 (AGGR_INIT_EXPR_ARG): New macro.
5322 (aggr_init_expr_nargs): New macro.
5323 (AGGR_INIT_EXPR_ARGP): New macro.
5324 (aggr_init_expr_arg_iterator): New.
5325 (init_aggr_init_expr_arg_iterator): New.
5326 (next_aggr_init_expr_arg): New.
5327 (first_aggr_init_expr_arg): New.
5328 (more_aggr_init_expr_args_p): New.
5329 (FOR_EACH_AGGR_INIT_EXPR_ARG): New.
5330 (stabilize_aggr_init): New declaration.
5331 (build_min_non_dep_call_list): Likewise.
5333 * tree.c (process_aggr_init_operands): New function.
5334 (build_aggr_init_array) New function.
5335 (build_cplus_new): Update to use new CALL_EXPR and
5336 AGGR_INIT_EXPR accessor macros. Replace use of build3 with
5337 build_aggr_init_array.
5338 (build_min_non_dep_call_list) New function.
5339 (build_min_nt): Assert input code parameter is not a variable
5340 length expression class.
5341 (build_min, build_min_non_dep): Likewise.
5342 (cp_tree_equal) <CALL_EXPR>: Iterate through the arguments
5343 to check for equality instead of recursing. Handle tcc_vl_exp
5345 (stabilize_call): Update to only handle CALL_EXPRs, not
5346 AGGR_INIT_EXPRs; use new CALL_EXPR accessor macros.
5347 (stabilize_aggr_init): New function.
5348 (stabilize_init): Use it.
5350 * cxx-pretty-print.c (pp_cxx_postfix_expression)
5351 <AGGR_INIT_EXPR, CALL_EXPR>: Update to use new CALL_EXPR and
5352 AGGR_INIT_EXPR accessor macros and argument iterators.
5354 * pt.c (tsubst_copy) <CALL_EXPR>: Replace build_nt with
5355 build_vl_exp. Iterate through the operands, recursively
5356 processing each one.
5357 (tsubst_copy_and_build) <CALL_EXPR>: Update to use new
5358 CALL_EXPR accessor macros.
5359 (value_dependent_expression_p) <default>: Handle tcc_vl_exp
5360 tree code classes. Use TREE_OPERAND_LENGTH instead of
5363 * semantics.c (finish_call_expr): Use build_nt_call_list
5364 instead of build_nt.
5365 (simplify_aggr_init_expr): Update to use new AGGR_INIT_EXPR
5366 accessor macros. Use build_call_array to construct the
5367 CALL_EXPR node instead of build3
5369 * decl2.c (build_offset_ref_call_from_tree): Use
5370 build_nt_call_list and build_min_non_dep_call_list instead
5371 of build_min_nt and build_min_non_dep.
5373 * parser.c (cp_parser_postfix_expression) <CPP_OPEN_PAREN>:
5374 Use build_nt_call_list instead of build_min_nt.
5376 2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5379 * call.c (build_conditional_expr): Improve error message.
5381 2007-02-13 Dirk Mueller <dmueller@suse.de>
5383 * friend.c (do_friend): Annotate warning about friend
5384 declarations in templates with OPT_Wnon_template_friend.
5385 Convert informal message from warning() to inform().
5387 2007-02-12 Simon Martin <simartin@users.sourceforge.net>
5388 Mark Mitchell <mark@codesourcery.com>
5391 * pt.c (do_decl_instantiation): Detect type mismatches in explicit
5392 instantiations for variables.
5394 2007-02-12 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5397 * cp-gimplify.c (gimplify_expr_stmt): Don't check extra_warnings.
5398 Check warn_unused_value just once.
5400 2007-02-11 Mark Mitchell <mark@codesourcery.com>
5403 * pt.c (determine_specialization): Use skip_artificial_parms_for.
5404 (fn_type_unificiation): Likewise.
5405 (get_bindings): Likewise.
5407 o2007-02-06 Mark Mitchell <mark@codesourcery.com>
5410 * decl.c (finish_function): Use DECL_REPLACEABLE.
5411 * tree.c (cp_cannot_inline_tree_fn): Likewise.
5413 2007-02-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
5415 * parser.c (cp_parser_primary_expression): Reformat overly long lines.
5417 2007-02-10 Richard Henderson <rth@redhat.com>, Jakub Jelinek <jakub@redhat.com>
5419 * decl.c (grokvardecl): Don't error if !have_tls.
5420 (grokdeclarator): Likewise.
5421 * parser.c (cp_parser_omp_threadprivate): Likewise.
5423 2007-02-07 Jakub Jelinek <jakub@redhat.com>
5426 * cp-gimplify.c (cp_genericize_r): Don't dereference invisiref
5427 parameters and result decls in omp clauses.
5428 (cxx_omp_privatize_by_reference): Pass also invisiref PARM_DECLs
5431 2007-02-05 Dirk Mueller <dmueller@suse.de>
5434 * parser.c (cp_parser_class_specifier): Always initialize bases.
5436 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
5438 * cp-tree.h (OMP_ATOMIC_CODE): Delete.
5439 (OMP_ATOMIC_DEPENDENT_P): Rewrite.
5440 * pt.c (tsubst_expr): Adjust for new format of dependent OMP_ATOMIC
5442 * semantics.c (finish_omp_atomic): Store a whole expression node
5443 in operand 1, and integer_zero_node in operand 0, for dependent
5444 OMP_ATOMIC. Rewrite to make flow easier to understand.
5446 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
5448 * decl.c (grokdeclarator): Use OPT_Wreturn_type instead of 0.
5450 2007-02-04 Kazu Hirata <kazu@codesourcery.com>
5452 * class.c, cp-tree.h, decl.c, decl2.c, g++spec.c, init.c,
5453 parser.c, pt.c, tree.c, typeck.c: Follow spelling conventions.
5455 2007-02-03 Douglas Gregor <doug.gregor@gmail.com>
5457 * parser.c (cp_lexer_get_preprocessor_token): Attach the C++0x
5458 keyword warning to -Wc++0x-compat.
5460 2007-02-03 Gabriel Dos Reis <gdr@integrable-solutions.net>
5462 * decl.c (grokdeclarator): Update documentation.
5464 2007-02-02 Jakub Jelinek <jakub@redhat.com>
5467 * decl.c (grokdeclarator): If __thread is used together with
5468 a storage class other than extern and static, clear thread_p
5469 after issuing diagnostics and fall through to checking the
5472 2007-01-30 Roger Sayle <roger@eyesopen.com>
5474 * error.c (dump_type_suffix): Avoid use of cp_build_binary_op when
5475 calculating the size of an array (to avoid recursive errors).
5477 2007-01-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5480 * typeck.c (build_binary_op): Fix logic for warning. Move warning
5482 * call.c (convert_like_real): Don't warn when converting to
5485 2007-01-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5487 * decl.c (pop_label): Replace warning with call to
5488 warn_for_unused_label.
5490 2007-01-28 Andrew Pinski <pinskia@gmail.com>
5493 * semantics.c (finish_pseudo_destructor_expr): Check the
5494 destrutor name by calling check_dtor_name.
5496 2007-01-24 Douglas Gregor <dgregor@osl.iu.edu>
5498 * lex.c (D_CPP0X): Rename.
5500 (reswords): D_CPP0X -> D_CXX0X.
5501 (init_reswords): Ditto.
5502 * parser.c (cp_lexer_get_preprocessor_token): Warn about the use
5503 of C++0x keywords as identifiers.
5505 2007-01-23 Simon Martin <simartin@users.sourceforge.net>
5508 * decl.c (duplicate_decls): Don't reset DECL_INVALID_OVERRIDER_P for
5511 2007-01-23 Ian Lance Taylor <iant@google.com>
5513 * typeck.c (convert_for_assignment): Only warn about a = b = c
5514 when converting to bool.
5516 2007-01-23 Roger Sayle <roger@eyesopen.com>
5518 * call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
5520 * typeck.c (ignore_overflows): Remove the remaining uses of
5521 TREE_CONSTANT_OVERFLOW.
5523 2007-01-20 Jan Hubicka <jh@suse.cz>
5525 * decl2.c (start_objects, start_static_storage_duration_function):
5526 Do not make the functions uninlinable.
5528 2007-01-17 Ian Lance Taylor <iant@google.com>
5530 * class.c (add_method): Call VEC_reserve_exact rather than passing
5531 a negative size to VEC_reserve.
5533 2007-01-11 Simon Martin <simartin@users.sourceforge.net>
5536 * tree.c (cp_tree_equal): Properly handle MODOP_EXPR trees.
5538 2007-01-10 Mark Mitchell <mark@codesourcery.com>
5541 * decl.c (make_typename_type): If the qualified name is not a
5542 type, issue an error.
5543 * parser.c (cp_parser_elaborated_type_specifier): Fix comment
5546 2007-01-08 Geoffrey Keating <geoffk@apple.com>
5548 * rtti.c: Include target.h.
5549 (emit_support_tinfos): If ! targetm.cxx.library_rtti_comdat (),
5550 don't emit typeinfo for fundamental types as weak.
5551 * Make-lang.in (cp/rtti.o): Update and correct dependencies.
5553 2007-01-08 Richard Guenther <rguenther@suse.de>
5555 * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.
5557 2007-01-08 Mark Shinwell <shinwell@codesourcery.com>
5559 * call.c (standard_conversion): Pass flag to
5560 vector_types_convertible_p to disallow emission of note.
5561 * typeck.c (convert_for_assignment): Pass flag to
5562 vector_types_convertible_p to allow emission of note.
5563 (ptr_reasonably_similar): Pass flag to vector_types_convertible_p
5564 to disallow emission of note.
5566 2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5569 * typeck.c (build_binary_op): Call overflow_warning if
5570 TREE_OVERFLOW_P is true for the result and not for any of the
5573 2007-01-06 Lee Millward <lee.millward@codesourcery.com>
5576 * class.c (add_method): Don't wait until template
5577 instantiation time to complain about duplicate methods.
5579 2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
5582 * semantics.c (finish_unary_op_expr): Warn only if result
5583 overflowed and operands did not.
5585 2007-01-05 Ian Lance Taylor <iant@google.com>
5587 * typeck.c (build_binary_op): Warn about comparing a non-weak
5590 2007-01-05 Douglas Gregor <doug.gregor@gmail.com>
5592 * pt.c (tsubst): Propagate the need for structural equality checks
5593 when reducing the level of template parameters.
5595 2007-01-03 Kazu Hirata <kazu@codesourcery.com>
5597 * pt.c: Fix a comment typo.
5599 2007-01-02 Ian Lance Taylor <iant@google.com>
5601 * semantics.c (maybe_convert_cond): Optionally warn when using an
5602 assignment as a condition.
5603 * typeck.c (convert_for_assignment): Optionally warn about
5604 assigning the result of an assignment to a bool.
5606 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
5608 * pt.c (canonical_template_parms): Correct typo in comment.
5610 2007-01-02 Douglas Gregor <doug.gregor@gmail.com>
5612 * typeck.c (structural_comptypes): Renamed from "comptypes".
5613 (comptypes): Use canonical type information to perform fast type
5614 comparison. When VERIFY_CANONICAL_TYPES, verify that the
5615 canonical type comparison returns the same results as we would see
5616 from the current, structural check. Support COMPARE_STRUCTURAL
5617 when we need structural checks.
5618 * decl.c (typename_compare): Fix comment.
5619 (build_typename_type): TYPENAME_TYPE nodes require structural
5620 equality checks, because they resolve different based on the
5622 (make_unbound_class_template): UNBOUND_CLASS_TEMPLATE nodes
5623 require structural equality checks (for now).
5624 (build_ptrmemfunc_type): Build the canonical pointer to member
5626 (compute_array_index_type): Whenever we build a new index type
5627 to represent the size of an array in a template, we need to mark
5628 this index type as requiring structural equality. This goes for
5629 arrays with value-dependent sizes with the current ABI, or all
5631 * tree.c (cplus_array_hash): New.
5632 (struct cplus_array_info): New.
5633 (cplus_array_compare): New.
5634 (cplus_array_htab): New.
5635 (build_cplus_array_type_1): Use a hash table to cache the array
5636 types we build. Build the canonical array type for each array
5638 (cp_build_qualified_type_real): When building a cv-qualified array
5639 type, use the hash table of array types and build canonical array
5641 (bind_template_template_parm): BOUND_TEMPLATE_TEMPLATE_PARM nodes
5642 use structural equality (for now).
5643 * cp-tree.h (COMPARE_STRUCTURAL): New.
5644 * pt.c (canonical_template_parms): New.
5645 (canonical_type_parameter): New.
5646 (process_template_parm): Find the canonical type parameter.
5647 (lookup_template_class): When we have named the primary template
5648 type, set the canonical type for our template class to the primary
5649 template type. If any of the template arguments need structural
5650 equality checks, the template class needs structural equality
5652 (tsubst): When reducing the level of a template template
5653 parameter, we require structural equality tests for the resulting
5654 parameter because its template parameters have not had their types
5655 canonicalized. When reducing a template type parameter, find the
5656 canonical reduced type parameter.
5657 (any_template_arguments_need_structural_equality_p): New.