Commit Graph

44732 Commits

Author SHA1 Message Date
Nathan Sidwell
399dedb996 re PR c++/9447 (using Base<T>::member does not work)
cp:
	PR c++/9447
	* decl.c (add_binding): Add bval local variable.
	(push_class_level_binding): Likewise. Allow a USING_DECL to be
	pushed.
	* decl2.c (do_class_using_decl):  The type of a using decl is
	unknown.
	* parser.c (cp_parser_postfix_expression): Refactor unqualified-id
	function call lookup code.
	* pt.c (tsubst): A USING_DECL will have unknown type.
	(tsubst_copy_and_build): Allow a using decl.
	(type_dependent_expression_p): A USING_DECL will make it
	dependent.
	* semantics.c (finish_member_declaration): Push a dependent using
	declaration.
testsuite:
	PR c++/9447
	* g++.dg/template/using1.C: New test.
	* g++.dg/template/using2.C: New test.
	* g++.dg/template/using3.C: New test.
	* g++.dg/template/using4.C: New test.

From-SVN: r69921
2003-07-29 11:16:50 +00:00
Alexandre Oliva
f67f773737 string-opt-9.c: strcmp returns int.
* gcc.c-torture/execute/string-opt-9.c: strcmp returns int.
* gcc.c-torture/execute/string-opt-10.c: Likewise.

From-SVN: r69916
2003-07-29 06:25:53 +00:00
Geoffrey Keating
5f0eabcc4d c-decl.c (c_expand_body_1): Use C_DECL_FILE_SCOPE to detect main function.
* c-decl.c (c_expand_body_1): Use C_DECL_FILE_SCOPE to detect
	main function.

From-SVN: r69913
2003-07-29 04:14:48 +00:00
Mark Mitchell
415d463626 re PR c++/11530 ([unit-at-a-time] inline static function not emitted with -O3)
PR c++/11530
	* parser.c (cp_parser_postfix_expression): Do not call mark_used.
	* semantics.c (finish_id_expression): Call mark_used for all
	declarations.

	PR c++/11530
	* g++.dg/opt/call1.C: New test.

From-SVN: r69911
2003-07-29 01:57:47 +00:00
Mark Mitchell
7b6d72fcfb re PR c++/11667 (wider-than-int enums never compare equal to 0)
PR c++/11667
	* c-common.c (shorten_compare): Take into account differences
	between C and C++ representation for enumeration types.
	* tree.h (set_min_and_max_values_for_integral_type): Declare.
	* stor-layout.c (set_min_and_max_values_for_integral_type): New
	function, broken out from ...
	(fixup_signed_type): ... here and ...
	(fixup_unsigned_type): ... here.

	PR c++/11667
	* call.c (standard_conversion): Allow all integral->enumeral
	conversions, after marking them as bad.
	* decl.c (finish_enum): Make sure that all enumerators are
	properly converted to the underlying type.
	(build_enumerator): Set DECL_CONTEXT for namespace-scope
	enumeration types.
	* pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly.
	(tsubst_enum): Tidy.

	* Make-lang.in (typeck.o): Depend on convert.h.
	(class.o): Likewise.
	(rtti.o): Likewise.
	* call.c: Include convert.h.
	(convert_arg_to_ellipsis): Use convert_to_real.
	* class.c: Include convert.h.
	(build_base_path): Use convert_to_integer.
	* rtti.c: Include convert.h.
	(build_headof): Use convert_to_integer.
	* typeck.c: Include convert.h.
	(decay_conversion): Use convert_to_integer.
	(build_unary_op): Use build_nop.
	(get_delta_difference): Use convert_to_integer.
	(build_ptrmemfunc): Avoid unncessary conversions.

From-SVN: r69909
2003-07-29 01:14:24 +00:00
GCC Administrator
92a6fb2cf2 Daily bump.
From-SVN: r69907
2003-07-29 00:16:36 +00:00
Zack Weinberg
14077d68ba c-decl.c: Update commentary, adjust blank lines throughout.
* c-decl.c: Update commentary, adjust blank lines throughout.
	(struct c_scope): Fix indentation.  Reorder members so
	outer-context pointers come first, booleans last.
	(duplicate_decls, define_label): Use a 'locus' variable for
	diagnostic locations in a few more places.
	(warn_if_shadowing): Un-split a conditional that fits on one line.
	(c_init_decl_processing): No need to clear current_scope and
	current_function_scope.
	(start_decl): Merge if/else if statements with same action.
	(push_parm_decl): Rename old_immediate_size_expand to use
	save_foo convention; save/restore around entire function.
	(grokdeclarator): Remove unnecessary braces.

From-SVN: r69903
2003-07-28 22:19:46 +00:00
Jan Hubicka
58579435ee decl2.c (mark_member_pointers): Verify that member pointer points to the function.
* decl2.c (mark_member_pointers): Verify that member pointer points to
	the function.

From-SVN: r69902
2003-07-28 21:59:30 +00:00
Hans-Peter Nilsson
b736595713 Wdeclaration-after-statement-1.c, [...]: New tests.
* gcc.dg/Wdeclaration-after-statement-1.c,
	gcc.dg/Wdeclaration-after-statement-2.c: New tests.

From-SVN: r69900
2003-07-28 20:15:44 +00:00
Hans-Peter Nilsson
85617eba1e c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn when warn_declaration_after_statement.
* c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn
	when warn_declaration_after_statement.  Call pedwarn_c90, not
	pedwarn.  Correct message: it's "ISO C90", not "ISO C89".
	* c-common.c (warn_declaration_after_statement): Define.
	* c-common.h (warn_declaration_after_statement): Declare.
	* c.opt (Wdeclaration-after-statement): New.
	* c-errors.c (pedwarn_c90): New function.
	* c-opts.c (c_common_handle_option) <case
	OPT_Wdeclaration_after_statement>: New.
	* c-tree.h (pedwarn_c90): Declare.
	* doc/invoke.texi (Option Summary): Document
	-Wdeclaration-after-statement.
	(Warning Options): Ditto.

Co-Authored-By: Michael Culbertson <Michael.J.Culbertson@wheaton.edu>

From-SVN: r69899
2003-07-28 20:03:25 +00:00
Jan Hubicka
f527d19649 * i386.md (memory attribute) Avoid accessing uninitialized memory
for ishift1 type instructions.

From-SVN: r69895
2003-07-28 18:13:57 +00:00
Jakub Jelinek
5dfa45d043 configure.in (--enable-checking): Add fold category.
* configure.in (--enable-checking): Add fold category.
	(ENABLE_FOLD_CHECKING): Define if requested.
	* configure: Rebuilt.
	* config.in: Rebuilt.
	* doc/install.texi: Document it.
	* fold-const.c: Include md5.h.
	[ENABLE_FOLD_CHECKING] (fold): Define to fold_1.
	[ENABLE_FOLD_CHECKING] (fold, fold_checksum_tree, fold_check_failed,
	print_fold_checksum): New functions.

	* fold-const.c (fold): Never modify argument passed to fold, instead
	change a copy and return it.
	* convert.c (convert_to_integer): Likewise.
testsuite/
	* gcc.c-torture/compile/20030725-1.c: New test.

From-SVN: r69886
2003-07-28 17:42:24 +02:00
Aldy Hernandez
66584e6417 20030505.c: Only run for SPE.
2003-07-28  Aldy Hernandez  <aldyh@redhat.com>

	* gcc.dg/20030505.c: Only run for SPE.
	Remove definition of opaque type.

From-SVN: r69884
2003-07-28 15:00:50 +00:00
Nathan Sidwell
7a3397c739 cp-tree.h (begin_compound_stmt): No scope arg is a bool.
* cp-tree.h (begin_compound_stmt): No scope arg is a bool.
	(finish_compound_stmt): Remove no scope arg.
	* decl.c (register_dtor_fn): Adjust begin_compound_stmt and
	end_compound_stmt calls.
	(expand_static_init, begin_destructor_body, begin_function_body,
	finish_function_body): Likewise.
	* decl2.c (start_objects, finish_objects,
	start_static_storage_duration_function,
	finish_static_storage_duration_function): Likewise.
	* init.c (begin_init_stmts, finish_init_stmts,
	construct_virtual_base, build_vec_init): Likewise.
	* method.c (do_build_assign_ref, synthesize_method): Likewise.
	* parser.c (cp_parser_compound_statement,
	cp_parser_implicitly_scoped_statement,
	cp_parser_already_scoped_statement): Likewise.
	* pt.c (tsubst_expr): Likewise.
	* semantics.c (begin_compound_stmt): No scope arg is a bool.
	(finish_compound_stmt): Remove no scope arg.

	* error.c (dump_expr) <COMPOUND_EXPR case>: A compound expr is
	always dyadic.

From-SVN: r69882
2003-07-28 11:06:31 +00:00
Andreas Jaeger
8376cf3db9 treetree.c: Convert remaining K&R prototypes to ISO C90.
treelang:
	* treetree.c: Convert remaining K&R prototypes to ISO C90.
	* tree1.c: Likewise.
	* parse.y: Likewise.
	* tree-convert.c: Likewise.

java:

	* jvspec.c: Convert to ISO C90 prototypes.

From-SVN: r69881
2003-07-28 06:39:29 +02:00
Nathanael Nerode
447673ded1 fixinc.svr4: Remove dead code.
* fixinc/fixinc.svr4: Remove dead code.  Remove now-unnecessary
	cleanup of junk after #else and #endif directives.  Collapse repeated
	clauses into for statment.

	* fixinc/fixincl.sh: GNU C -> GCC.  Add usage comment.

From-SVN: r69870
2003-07-28 02:15:25 +00:00
GCC Administrator
a9f31c7e72 Daily bump.
From-SVN: r69868
2003-07-28 00:16:06 +00:00
Zack Weinberg
a8ccdffedc c-decl.c (struct c_scope): Remove keep_if_subblocks field.
* c-decl.c (struct c_scope): Remove keep_if_subblocks field.
	(keep_next_if_subblocks): Rename next_is_function_body.
	(pushlevel): Adjust commentary.  Always set ->keep on the
	outermost level of a function.  Don't set ->keep_if_subblocks.
	(poplevel): Adjust commentary.  Don't look at ->keep_if_subblocks.
	(store_parm_decls): Adjust to match.
	(finish_function): Adjust to match.
	Call poplevel with all three arguments zero.

From-SVN: r69865
2003-07-28 00:12:32 +00:00
Zack Weinberg
66db6b6259 c-decl.c (store_parm_decls_newstyle, [...]): New functions split out of store_parm_decls.
* c-decl.c (store_parm_decls_newstyle, store_parm_decls_oldstyle):
	New functions split out of store_parm_decls.
	Avoid unnecessary work. Use local variables consistently.
	(store_parm_decls): Likewise.

	(finish_function): No need to set functionbody flag on call to
	poplevel.
	(struct language_function): Remove scope field.
	(c_push_function_context, c_pop_function_context): No need to
	save and restore current_scope.

From-SVN: r69862
2003-07-27 20:07:04 +00:00
Mark Mitchell
b7a78333b1 call.c (standard_conversion): Tweak handling of pointer-to-member types.
* call.c (standard_conversion): Tweak handling of
	pointer-to-member types.
	* pt.c (tsubst): Correctly qualify pointers-to-data member types.
	* typeck.c (comp_ptr_ttypes_real): Check qualifiers on
	pointer-to-data member types.

	* g++.dg/template/ptrmem6.C: New test.

From-SVN: r69855
2003-07-27 18:25:57 +00:00
Nathan Sidwell
90ea7324e8 extend.texi (Deprecated Features): Implicit typename is gone.
* doc/extend.texi (Deprecated Features): Implicit typename is
	gone. Default args on types is going.

From-SVN: r69853
2003-07-27 16:57:18 +00:00
Nathan Sidwell
c67d36d0d7 parser.c (cp_parser_type_parameter): Reformat.
* parser.c (cp_parser_type_parameter): Reformat.
	(cp_parser_parameter_declaration): Deprecate default args where
	not allowed.

From-SVN: r69852
2003-07-27 16:51:14 +00:00
Geoffrey Keating
18f3e349aa varasm.c (output_constant_def_contents): Use ASM_DECLARE_CONSTANT_NAME if defined.
* varasm.c (output_constant_def_contents): Use
	ASM_DECLARE_CONSTANT_NAME if defined.
	* doc/tm.texi (Label Output): Document ASM_DECLARE_CONSTANT_NAME.
	* config/darwin.h (ASM_DECLARE_OBJECT_NAME): Ensure zero-sized
	objects get at least one byte to prevent assembler problems.
	(ASM_DECLARE_CONSTANT_NAME): New.

Index: testsuite/ChangeLog
	* gcc.c-torture/compile/zero-strct-2.c: New test.

From-SVN: r69842
2003-07-27 01:48:11 +00:00
GCC Administrator
404edd110e Daily bump.
From-SVN: r69840
2003-07-27 00:16:07 +00:00
Nathan Sidwell
f369aae49c * cfns.h: Rebuilt.
From-SVN: r69833
2003-07-26 19:31:30 +00:00
Nathan Sidwell
079167d393 changelog
From-SVN: r69831
2003-07-26 19:12:56 +00:00
Nathan Sidwell
2a3398e124 cp-tree.h (begin_init_stmts, [...]): Remove.
* cp-tree.h (begin_init_stmts, finish_init_stmts): Remove.
	(begin_global_stmt_expr, finish_global_stmt_expr): Remove.
	* init.c (begin_init_stmts): Make static. Return is_global
	value. Always call begin_stmt_expr.
	(finish_init_stmts): Make static. Add is_global parm. Always
	building a stmt tree.
	(build_aggr_init): Adjust begin_init_stmts, finish_init_stmts calls.
	(build_vec_init): Likewise. Always building a stmt tree.
	(expand_default_init): Always building a stmt tree.
	(get_temp_regvar): Likewise.
	* semantics.c (begin_global_stmt_expr,
	finish_global_stmt_expr): Remove.

From-SVN: r69830
2003-07-26 19:10:26 +00:00
J"orn Rennecke
11a004efdb Makefile.in (ifcvt.o): Depend on target.h
* Makefile.in (ifcvt.o): Depend on target.h
	* ifcvt.c (target.h): Include.
	(if_convert): Don't call mark_loop_exit_edges if we can't
	modify jumps.

From-SVN: r69829
2003-07-26 19:38:42 +01:00
Gerald Pfeifer
6cbf57c94c * doc/install.texi (Testing): Adjust required versions of DejaGnu.
From-SVN: r69817
2003-07-26 16:04:10 +00:00
Richard Henderson
a6c14a644c re PR inline-asm/11676 (operand to volatile asm incorrectly removed)
PR inline-asm/11676
        * cse.c (count_reg_usage): Handle asm_operands properly.

From-SVN: r69816
2003-07-26 08:53:14 -07:00
Nathan Sidwell
cd65f08202 document default arg deprecations
From-SVN: r69815
2003-07-26 14:09:35 +00:00
Roger Sayle
cc42f5f54c builtins.def (DEF_FALLBACK_BUILTIN): Delete.
* builtins.def (DEF_FALLBACK_BUILTIN): Delete.
	(DEF_EXT_FALLBACK_BUILTIN): Delete.
	(BUILT_IN_BZERO, BUILT_IN_BCOPY, BUILT_IN_BCMP): Declare using
	the regular DEF_EXT_LIB_BUILTIN macro.
	(BUILT_IN_FPUTC, BUILT_IN_FPUTS, BUILT_IN_FWRITE): Declare using
	the regular DEF_LIB_BUILTIN macro.
	(BUILT_IN_PUTCHAR_UNLOCKED, BUILT_IN_PUTS_UNLOCKED,
	BUILT_IN_FPUTC_UNLOCKED, BUILT_IN_FPUTS_UNLOCKED,
	BUILT_IN_FWRITE_UNLOCKED): Declare using the regular
	DEF_EXT_LIB_BUILTIN macro.

	* c-decl.c (duplicate_decls): Remove code to handle builtin
	functions prototyped without an argument list.

From-SVN: r69814
2003-07-26 13:27:20 +00:00
Danny Smith
92e7a6efaf winnt.c: Revert 2003-07-08 change.
* config/i386/winnt.c: Revert 2003-07-08 change.
	(i386_pe_section_type_flags): Remove error_with_decl here too.

From-SVN: r69813
2003-07-26 11:43:15 +00:00
Gabriel Dos Reis
ba9cfcb5e7 pe.c (arm_mark_dllimport): Don't use xxx_with_decl.
* config/arm/pe.c (arm_mark_dllimport): Don't use xxx_with_decl.
	* config/mcore/mcore.c (mcore_mark_dllimport): Likewise.
	* config/v850/v850.c (v850_handle_data_area_attribute): Likewise.
	(v850_handle_data_area_attribute): Likewise.

From-SVN: r69812
2003-07-26 11:27:40 +00:00
Geoffrey Keating
d2908a507b Makefile.in (libbackend.o): Remove options_.h.
* Makefile.in (libbackend.o): Remove options_.h.
	(mostlyclean): Likewise.

From-SVN: r69810
2003-07-26 07:37:55 +00:00
Geoffrey Keating
0e5da0beef rs6000.c (rs6000_output_function_epilogue): Don't insert a label at the end of an function under Mach-O.
* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't
	insert a label at the end of an function under Mach-O.

From-SVN: r69809
2003-07-26 07:34:21 +00:00
Geoffrey Keating
863d3dfb5a * c-decl.c (c_static_assembler_name): Remove TREE_STATIC test.
From-SVN: r69808
2003-07-26 07:16:48 +00:00
GCC Administrator
037af9d77b Daily bump.
From-SVN: r69805
2003-07-26 00:16:07 +00:00
Aldy Hernandez
36252949ae rs6000.c (is_ev64_opaque_type): Only check pointer equality.
2003-07-25  Aldy Hernandez  <aldyh@redhat.com>

	* config/rs6000/rs6000.c (is_ev64_opaque_type): Only check pointer
	equality.
	(spe_init_builtins): Declare __ev64_opaque__ as a builtin type.

	* config/rs6000/spe.h: Remove __ev64_opaque__ definition.

From-SVN: r69802
2003-07-25 23:49:30 +00:00
Nathan Sidwell
ca3c62ecf1 * g++.dg/other/error2.C: Tweak expected errors.
From-SVN: r69796
2003-07-25 17:22:37 +00:00
Nathan Sidwell
c7b62f1472 cp-tree.h (build_compound_expr): Take LHS & RHS args.
* cp-tree.h (build_compound_expr): Take LHS & RHS args.
	(build_x_compound_expr_from_list): Declare.
	* typeck.c (build_x_compound_expr_from_list): New.
	(build_x_compound_expr): Adjust.
	(build_compound_expr): Remove unreachable code. Take two
	parameters, adjust.
	* decl.c (grok_reference_init): Use
	build_x_compound_expr_from_list.
	(expand_static_init): Adjust build_compound_expr call.
	(cxx_maybe_build_cleanup): Likewise.
	* init.c (perform_member_init): Use
	build_x_compound_expr_from_list.
	(build_new_1): Likewise.
	(build_vec_delete): Adjust build_compound_expr calls.
	(build_vbase_delete): Likewise.
	* typeck2.c (store_init_value): Use
	build_x_compound_expr_from_list.
	(build_functional_cast): Likewise.

From-SVN: r69794
2003-07-25 16:52:47 +00:00
Nathan Sidwell
42eaed4985 cp-tree.h (enum tsubst_flags_t): Add tf_user.
* cp-tree.h (enum tsubst_flags_t): Add tf_user.
	* decl.c (make_typename_type): Pass it.
	* pt.c (lookup_template_class): Use it.
	(resolve_typename_type): Pass it.
	* semantics.c (finish_template_type): Pass it.

From-SVN: r69793
2003-07-25 16:45:34 +00:00
Nathan Sidwell
22038b2cf5 re PR c++/11617 (g++ does not report missing member functions)
cp:
	PR c++/11617
	* cp-tree.h (qualified_name_lookup_error): Declare.
	* pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for
	errors.
	(tsubst_expr) <DECL_STMT case>: Likewise.
	(tsubst_copy_and_build) <COMPONENT_REF case>: Likewise.
	* semantics.c (qualified_name_lookup_error): New, broken out of ...
	(finish_id_expression): ... here. Use it.
testsuite:
	PR c++/11617
	* g++.dg/template/lookup2.C: New test.
	* g++.dg/template/memclass1.C: Remove instantiated from error.

From-SVN: r69790
2003-07-25 16:35:20 +00:00
Falk Hueffner
8460025b07 * cfns.gperf: Add '%%' delimiter to placate gperf 3.0.
From-SVN: r69787
2003-07-25 13:57:43 +00:00
Gabriel Dos Reis
0fe37f6868 passes.texi (Passes): Mention pretty-printing and diagnostic files.
* doc/passes.texi (Passes): Mention pretty-printing and
        diagnostic files.

From-SVN: r69783
2003-07-25 11:48:02 +00:00
Nathan Sidwell
b8bae36530 * decl.c (force_poplevels): Fix warning call.
From-SVN: r69782
2003-07-25 10:58:33 +00:00
Nathan Sidwell
50fc59e78b extend.texi (Function Attributes): GNU C++ does now allow unused parameter decls.
* doc/extend.texi (Function Attributes): GNU C++ does now allow
	unused parameter decls.
	(Attribute Syntax): GNU C++ does not allow label attributes to be
	after the ':'.

From-SVN: r69781
2003-07-25 10:52:31 +00:00
Gabriel Dos Reis
cd47580517 objc-act.c (objc_check_decl): Don't use xxx_with_decl.
* objc/objc-act.c (objc_check_decl): Don't use xxx_with_decl.
        (objc_declare_class): Likewise.
        (error_with_ivar): Likewise.
        (start_class): Likewise.
        (warn_with_method): Likewise.

java/
        * expr.c (expand_java_field_op): Don't use xxx_with_decl
        (expand_java_field_op): Likewise.
        * class.c (layout_class_method): Likewise
        (emit_register_classes): Likewise.
        * decl.c (pushdecl): Likewise.
        (poplevel): Likewise.
        (force_poplevels): Likewise.
        (give_name_to_locals): Likewise.
        * check-init.c (check_for_initialization): Likewise.

From-SVN: r69780
2003-07-25 10:27:43 +00:00
Nathan Sidwell
e710066d27 Revert patch for 11617 which accidently crept in
From-SVN: r69779
2003-07-25 10:20:09 +00:00
Nathan Sidwell
a91db71189 re PR c++/11596 (ICE with int templates)
cp:
	PR c++/11596
	* pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove.
	(tsubst_template_arg): New.
	(tsubst_template_arg_vector): Rename to ...
	(tsubst_template_args): ... this. Accept a TREE_LIST form. Use
	tsubst_template_arg.
	(coerce_template_parms): Use tsubst_template_arg for default
	value.
	(tsubst_template_parms): Likewise.
	(tsubst_aggr_type): Adjust.
	(tsubst_decl): Likewise.
	(tsubst): Use tsubst_template_arg for a DOMAIN. Adjust.
	(tsubst_copy) <TEMPLATE_ID_EXPR case>: Use tsubst_template_args.
testsuite:
	PR 11596
	* g++.dg/template/defarg3.C: New test.

	* g++.dg/ext/packed2.C: Pack member struct too. Explain why.

From-SVN: r69776
2003-07-25 10:16:13 +00:00