aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
AgeCommit message (Collapse)AuthorFilesLines
2005-01-04re PR c/19152 (IMA and external inline don't get along)Andrew Pinski1-11/+42
2005-01-04 Andrew Pinski <pinskia@physics.uc.edu> PR c/19152 * c-decl.c (diagnose_mismatched_decls): Accept "extern inline" declared after the full declaration if the are in two different TUs. From-SVN: r92918
2005-01-01re PR c/19031 (#pragma weak handling changes in 4.0.0)Richard Henderson1-0/+2
PR c/19031 * c-decl.c (pop_file_scope): Call maybe_apply_pending_pragma_weaks. * c-lang.c (finish_file): Don't do it here. * objc/objc-act.c (objc_finish_file): Likewise. * cgraph.c (decl_assembler_name_equal): New. (cgraph_node_for_asm, cgraph_varpool_node_for_asm): New. (cgraph_varpool_node): Actually link up cgraph_varpool_nodes. * cgraph.h (struct cgraph_varpool_node): Add next. (cgraph_node_for_asm, cgraph_varpool_node_for_asm): Declare. * varasm.c (assemble_alias): Mark the target as needed. From-SVN: r92803
2005-01-01re PR middle-end/17544 (incorrect -Wunreachable-code warning for mains with ↵Steven Bosscher1-2/+9
a return statement) * emit-rtl.c (add_insn_before): Fix comment typo. PR middle-end/17544 * c-decl.c (finish_function): If compiling C99, annotate the compiler generated return with the current file name and line 0. * tree-cfg.c (remove_useless_stmts_warn_notreached): Only warn if the source line is greater than 0. (remove_bb): Likewise. cp/ PR middle-end/17544 * decl.c (finish_function): Fix comment. Annotate the compiler generated return with the current file name and line 0. testsuite/ * gcc.dg/20041231-1.C: New test. * g++.dg/warn/Wunreachable-code-1.C: New test. From-SVN: r92784
2004-12-31re PR middle-end/17799 (Non-optimizing compile loses 'this')Richard Henderson1-0/+1
PR middle-end/17799 * function.c (use_register_for_decl): Check DECL_IGNORED_P instead of DECL_ARTIFICIAL. (assign_parms_augmented_arg_list): Set DECL_IGNORED_P. * c-decl.c (build_compound_literal): Likewise. * dwarf2asm.c (dw2_force_const_mem): Likewise. * gimplify.c (create_artificial_label): Likewise. * tree-inline.c (expand_call_inline): Likewise. * var-tracking.c (vt_initialize): Likewise. * tree-outof-ssa.c (create_temp): Copy DECL_IGNORED_P. cp/ * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P. * class.c (build_vtable): Don't conditionallize setting it based on DWARF2_DEBUG. (layout_class_type): Set DECL_IGNORED_P. * decl2.c (get_guard): Likewise. * rtti.c (get_tinfo_decl, build_lang_decl): Likewise. * tree.c (build_local_temp): Likewise. From-SVN: r92781
2004-12-21re PR c/18963 (static and nested declarations cause an ice)James A. Morrison1-24/+0
2004-12-21 James A. Morrison <phython@gcc.gnu.org> PR c/18963 * c-decl.c (pushdecl): Remove block trying to merge static function declarations at block scope to file scope declarations. testsuite: PR c/18963 * gcc.dg/pr18963-1.c: New test. From-SVN: r92460
2004-12-21re PR c/18596 (ICE in make_decl_rtl)James A. Morrison1-8/+10
2004-12-19 James A. Morrison <phython@gcc.gnu.org> PR c/18596 * c-parse.in (initdcl): Don't process a declaration if start_decl fails. (notype_initdcl): Don't process a declaration if start_decl fails. * c-decl.c (start_decl): Fail if grokdeclarator fails. (grokdeclarator): Fail if a function definition has an invalid storage class. * c-typeck.c (start_init): Treat error_mark_node the same as 0. testsuite: PR c/18596 * gcc.dg/funcdef-storage-1.c (foo): Remove. * gcc.dg/pr18596-1.c: Use dg-error. (dg-options): Use -fno-unit-at-a-time. * gcc.dg/pr18596-2.c: New test. * gcc.dg/pr18596-3.c: New test. From-SVN: r92459
2004-12-20re PR c++/19044 (Alternate asm name for atan ignored when calling ↵Matt Austern1-8/+1
__builtin_atan) PR c++/19044 * c-common.c (set_builtin_user_assembler_name): New. * c-common.h (set_builtin_user_assembler_name): Declare. * c-decl.c (finish_decl): Use set_builtin_user_assembler_name * decl.c (make_rtl_for_nonlocal_decl): Use set_builtin_user_assembler_name * g++.dg/ext/builtin6.C: New From-SVN: r92428
2004-12-18re PR middle-end/16417 (crappy code (gcc.c-torture/compile/20020210-1.c) in ↵Richard Henderson1-2/+5
arguments causes ICE) PR middle-end/16417 * c-decl.c (store_parm_decls): Clarify get_pending_sizes insertion comment. * c-objc-common.c (c_cannot_inline_tree_fn): Remove pending sizes checks. * c-tree.h (struct lang_decl): Remove pending_sizes. * function.c: Include tree-gimple.h (assign_parm_setup_reg): Remove callee-copies code. (gimplify_parm_type, gimplify_parameters): New functions. (expand_pending_sizes): Remove. (expand_function_start): Don't call it. * gimplify.c (gimplify_expr): Examine DECL_VALUE_EXPR for PARM_DECL. (gimplify_body): Add do_parms argument. Use gimplify_parameters. (gimplify_function_tree): Setup cfun. Update gimplify_body call. * tree-gimple.h (gimplify_body): Update decl. * tree-inline.c (initialize_inlined_parameters): Update gimplify_body call. * tree.h (gimplify_parameters): Declare. * Makefile.in (function.o): Depend on TREE_GIMPLE_H. From-SVN: r92373
2004-12-18c-decl.c (finish_struct): Add DECL_EXPR for variable sized structures seen ↵Richard Henderson1-0/+6
inside functions. * c-decl.c (finish_struct): Add DECL_EXPR for variable sized structures seen inside functions. From-SVN: r92371
2004-12-18c-decl.c (grokdeclarator): Save variable array size before subtracting 1, ↵Richard Henderson1-2/+6
rather than after. * c-decl.c (grokdeclarator): Save variable array size before subtracting 1, rather than after. From-SVN: r92370
2004-12-17c-decl.c (diagnose_mismatched_decls): Accept mismatched function types: void ↵Dale Johannesen1-1/+13
with previous implicit int. 2004-12-17 Dale Johannesen <dalej@apple.com> * c-decl.c (diagnose_mismatched_decls): Accept mismatched function types: void with previous implicit int. From-SVN: r92329
2004-11-30re PR c/18596 (ICE in make_decl_rtl)James A. Morrison1-5/+13
2004-11-26 James A. Morrison <phython@gcc.gnu.org> PR middle-end/18596 * c-decl.c (grokdeclarator): Reset DECL_INTIAL to error_mark_node on errors. testsuite: * gcc.dg/pr18596-1.c: New test. From-SVN: r91504
2004-11-19c-decl.c (push_scope): Remove "\n" from end of diagnostic for too many ↵Joseph Myers1-1/+1
nested scopes. * c-decl.c (push_scope): Remove "\n" from end of diagnostic for too many nested scopes. From-SVN: r90936
2004-11-15re PR c/18498 (gcc allows non-integral bitfield types)Joseph Myers1-4/+4
PR c/18498 * c-decl.c (grokdeclarator): Call check_bitfield_type_and_width after processing the declarator. testsuite: * gcc.dg/bitfld-13.c: New test. From-SVN: r90696
2004-11-09builtins.c, [...]: Say "argument" instead of "arg" in diagnostics.Joseph Myers1-1/+2
* builtins.c, c-common.c, c-decl.c, c-format.c: Say "argument" instead of "arg" in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Update expected diagnostic. From-SVN: r90338
2004-11-09builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as ↵Joseph Myers1-3/+3
appropriate. * builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h, c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c, gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c, tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/c4x/c4x.c, config/darwin.c, config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/iq2000/iq2000.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/rs6000/host-darwin.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/symbian.c, config/stormy16/stormy16.c, config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate. Use %' as apostrophe in diagnostics where applicable. Use %< and %> in place of '' quotes where applicable. Use %qs in place of %<%s%>. Consistently quote __builtin function names. ada: * misc.c (gnat_handle_option): Use %< and %> for quoting in warning message. cp: * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for quoting in diagnostics. * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for quoting in printf format. * decl.c (duplicate_decls, start_decl): Use %qD instead of unquoted %D. objc: * objc-act.c: Use %q, %< and %> for quoting in diagnostics. testsuite: * gcc.dg/builtin-prefetch-1.c: Adjust expected messages. From-SVN: r90337
2004-11-07c-decl.c (finish_struct): Use complete sentences for diagnostic for ↵Joseph Myers1-3/+16
structures or unions with no members... * c-decl.c (finish_struct): Use complete sentences for diagnostic for structures or unions with no members or named members. From-SVN: r90217
2004-11-01re PR c/18239 (ICE in get_parm_info with werid attribute)Joseph Myers1-2/+4
PR c/18239 * c-decl.c (get_parm_info): Allow FUNCTION_DECLs to appear amongst parameter declarations. testsuite: * gcc.dg/parm-impl-decl-1.c, gcc.dg/parm-impl-decl-2.c: New tests. From-SVN: r89956
2004-10-30re PR c/16666 (dremf type conflict)Joseph Myers1-3/+1
PR c/16666 * c-decl.c (start_function): Don't check for DECL_BUILT_IN when determining whether to copy parameter types from a previous prototype declaration. testsuite: * gcc.dg/dremf-type-compat-1.c, gcc.dg/dremf-type-compat-2.c, gcc.dg/dremf-type-compat-3.c, gcc.dg/dremf-type-compat-4.c, gcc.dg/old-style-prom-1.c, gcc.dg/old-style-prom-2.c, gcc.dg/old-style-prom-3.c: New tests. From-SVN: r89883
2004-10-25re PR middle-end/17407 (ICE in int_mode_for_mode)Andrew Pinski1-5/+0
2004-10-25 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/17407 * c-decl.c (grokdeclarator) <case cdk_array>: Remove the call layout_type as it is already done by build_array_type. * tree.c (build_array_type): Layout the type even 2004-10-25 Andrew Pinski <pinskia@physics.uc.edu> PR c++/18121 * decl.c (grokdeclarator) <case cdk_array>: Remove the call layout_type as it is already done by create_array_type_for_decl. 2004-10-25 Andrew Pinski <pinskia@physics.uc.edu> PR middle-end/17407 * gcc.c-torture/compile/pr17407.c: New test. PR c++/18121 * g++.dg/template/array8.C: New test. From-SVN: r89533
2004-10-21re PR objc/17923 (const-str-[34].m fails on the mainline (next runtime))Andrew Pinski1-3/+2
2004-10-21 Andrew Pinski <pinskia@physics.uc.edu> PR objc/17923 * tree.c (staticp): A CONST_DECL has static storage if either TREE_STATIC or DECL_EXTERNAL is set. * c-decl.c (pushdecl_top_level): Accept CONST_DECLs which can have null names. 2004-10-21 Andrew Pinski <pinskia@physics.uc.edu> PR objc/17923 * objc-act.c (objc_build_string_object): Create a CONST_DECL for the NeXT runtime case. 2004-10-21 Andrew Pinski <pinskia@physics.uc.edu> PR objc/17923 * objc.dg/const-str-7.m: New test. From-SVN: r89384
2004-10-14re PR c/17023 (ICE with nested functions in parameter declaration)Richard Henderson1-1/+2
PR c/17023 * c-decl.c (store_parm_decls_oldstyle): Care for parameter type as error_mark_node. * c-parse.in (compstmt_primary_start): Check cur_stmt_list non-null instaed of current_function_decl non-null. From-SVN: r89063
2004-10-14c-tree.h (enum c_typespec_kind, [...]): New.Joseph Myers1-9/+55
* c-tree.h (enum c_typespec_kind, struct c_typespec, parser_xref_tag): New. (struct c_declspecs): Add tag_defined_p. Adjust definition of typedef_p. (declspecs_add_type): Adjust prototypes. * c-parse.in (%union): Add tstype. (typespec_nonattr, typespec_attr, typespec_reserved_nonattr, typespec_reserved_attr, typespec_nonreserved_nonattr, structsp_attr, structsp_nonattr): Change to tstype. Update actions. * c-decl.c (build_null_declspecs): Initialize tag_defined_p. (declspecs_add_type): Update to take struct c_typespec argument. Set tag_defined_p and typedef_p as appropriate. (xref_tag): Rename to parser_xref_tag and replace by wrapper. Update to return struct c_typespec. (shadow_tag_warned): Don't let empty declarations with qualifiers or storage class specifiers redeclare a tag if a previous declaration is visible. testsuite: * gcc.dg/c99-tag-3.c, gcc.dg/declspec-14.c: New tests. From-SVN: r89021
2004-10-13toplev.c (compile_file): Call mudflap_finish_file from here ...Frank Ch. Eigler1-5/+0
2004-10-13 Frank Ch. Eigler <fche@redhat.com> * toplev.c (compile_file): Call mudflap_finish_file from here ... * c-decl.c (c_write_global_declarations): ... instead of here ... * cp/decl.c (cp_finish_file): ... and here. * tree-mudflap.c (mudflap_enqueue_decl): Reword a warning message. From-SVN: r88995
2004-10-10re PR c/17881 (Incomplete type warning is issued even for prototypes)Joseph Myers1-7/+11
PR c/17881 * c-decl.c (grokparms): Don't warn for parameters of incomplete type in declarations that are not definitions except for the case of parameters of void type. testsuite: * parm-incomplete-1.c: New test. From-SVN: r88850
2004-10-10re PR c/17189 (bogus warning for struct Foo { int; };)Joseph Myers1-10/+12
PR c/17189 * c-decl.c (grokfield): Make diagnostic for bad cases of unnamed fields a pedwarn. Pedwarn here for unnamed structs/unions if pedantic. * c-parse.in (component_decl): Don't pedwarn here for unnamed fields. testsuite: * gcc.dg/anon-struct-5.c: New test. From-SVN: r88834
2004-10-05c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in system headers.Joseph Myers1-1/+1
* c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in system headers. testsuite: * gcc.dg/complex-2.c, gcc.dg/complex-2.h: New test. From-SVN: r88571
2004-10-05c-decl.c (pushdecl): When an extern declaration at block scope refers to a ↵Joseph Myers1-0/+1
visible entity with... * c-decl.c (pushdecl): When an extern declaration at block scope refers to a visible entity with internal linkage, use the old DECL rather than the new one. testsuite: * gcc.c-torture/compile/20041005-1.c: New test. From-SVN: r88570
2004-10-03PR c/17178, PR c/17820Andrew Pinski1-4/+2
2004-10-03 Andrew Pinski <pinskia@physics.uc.edu> PR c/17178, PR c/17820 * c-decl.c (pop_scope): Do not warn about unused static variables as they warned in the middle-end. 2004-10-03 Andrew Pinski <pinskia@physics.uc.edu> PR c/17178 * gcc.dg/unused-4.c: Adjust to be correct. PR c/17820 * gcc.dg/unused-7.c: New test. From-SVN: r88467
2004-10-03c-aux-info.c, [...]: Follow code formatting conventions.Joseph Myers1-38/+38
* c-aux-info.c, c-common.c, c-common.h, c-cppbuiltin.c, c-decl.c, c-format.c, c-incpath.c, c-lex.c, c-objc-common.c, c-opts.c, c-parse.in, c-pch.c, c-ppoutput.c, c-pragma.c, c-typeck.c: Follow code formatting conventions. From-SVN: r88462
2004-10-01c-decl.c (c_expand_body): Update call tree_rest_of_compilation.Jan Hubicka1-1/+1
* c-decl.c (c_expand_body): Update call tree_rest_of_compilation. * cgraphunit.c (cgraph_build_static_cdtor): Likewise. * toplev.h (tree_rest_of_compilation): Update prototype. * tree-optimize.c (tree_rest_of_compilation): Kill nested_p argument. * misc.c (gnat_expand_body): Update call of tree_rest_of_compilation. * semantics.c (expand_body): Update call of tree_rest_of_compilation. * f95-lang.c (gfc_expand_function): Update call of tree_rest_of_compilation. * trans-decl.c (gfc_generate_constructors): Likewise. * java.c (java_expand_body): Update call of tree_rest_of_compilation. * treetree.c (treeland_expand_function): Update call of tree_rest_of_compilation. From-SVN: r88396
2004-09-30FIxed an IMA bug showed up in parse and gzip.Fariborz Jahanian1-1/+1
OKed by Richard Henderson. From-SVN: r88312
2004-09-29re PR c/7425 (deprecated attribute doesn't merge with multiple declarations)Joseph Myers1-0/+4
PR c/7425 * c-decl.c (merge_decls): Merge TREE_DEPRECATED. cp: * decl.c (duplicate_decls): Merge TREE_DEPRECATED. testsuite: * gcc.dg/deprecated-3.c, g++.dg/warn/deprecated-2.C: New tests. From-SVN: r88303
2004-09-28re PR c/16409 (ICE in size_binop, at fold-const.c)Joseph Myers1-1/+15
PR c/16409 * c-decl.c (start_decl): Check for initializing incomplete array of VLAs. (build_compound_literal): Check for TYPE being error_mark_node. * c-parse.in (primary): Check for VLA compound literals. testsuite: * gcc.dg/vla-init-2.c, gcc.dg/vla-init-3.c, gcc.dg/vla-init-4.c, gcc.dg/vla-init-5.c: New tests. From-SVN: r88248
2004-09-24re PR c/17188 (struct Foo { } redefinition)Joseph Myers1-6/+22
PR c/17188 * c-decl.c (diagnose_mismatched_decls): Check for duplicate declarations of enumerators. (start_struct): Check TYPE_SIZE rather than TYPE_FIELDS to check for redefinition. Check for nested redefinition. (finish_struct): Don't check for nested redefinition. (start_enum): Check for nested redefinition. testsuite: * gcc.dg/nested-redef-1.c, gcc.dg/pr17188-1.c: New tests. * gcc.dg/decl-3.c: Adjust expected message. From-SVN: r88063
2004-09-22c-decl.c (implicitly_declare): Call maybe_apply_renaming_pragma.Mark Mitchell1-1/+7
* c-decl.c (implicitly_declare): Call maybe_apply_renaming_pragma. (finish_decl): Likewise. From-SVN: r87840
2004-09-20cgraph.c (cgraph_unnest_node): New function.Jan Hubicka1-15/+15
* cgraph.c (cgraph_unnest_node): New function. (c_finalize): Rename to .... (c_warn_unused_result_recursivly): ... this one; do only the warning (finish_function): Finalize the toplevel function; do not lower nested tree. * cgraph.h (cgraph_unnest_node): Declare. * cgraphunit.c (decide_is_function_needed): Do not use cgraph nestedness datastructure. * cse.c (cse_insn): Do not cprop nonlocal LABEL_REFs. * reload1.c (set_label_offsets): Fix call of set_label_offsets. * tree-nested.c (finlize_nesting_tree_1): Use un-nesting code. From-SVN: r87771
2004-09-17c-tree.h (enum c_typespec_keyword): New.Joseph Myers1-216/+404
* c-tree.h (enum c_typespec_keyword): New. (struct c_declspecs): Adjust description of "type". Remove specbits, explicit_int_p and explicit_char_p. Rename typedef_signed_p to explicit_signed_p. Add default_int_p, long_p, short_p, signed_p, unsigned_p and complex_p. (finish_declspecs): New. * c-parse.in (datadef, datadecl, setspecs, decl, component_decl, typename): Call finish_declspecs. * c-decl.c (finish_declspecs): New. (declspecs_add_type): Check for combinations which cannot occur in valid specifier lists. Update comments. (shadow_tag_warned): Remove checks done in finish_declspecs. Don't report useless type name if type defaulted to int. (grokdeclarator): Remove checks and actions done in finish_declspecs. Don't allow for type being NULL. Update for datastructures changes. Initialize decl_attr. (build_null_declspecs, quals_from_declspecs): Update for datastructures changes. testsuite: * gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c: Update expected messages. * gcc.dg/declspec-13.c: New test. From-SVN: r87660
2004-09-17basic-block.h, [...]: Fix comment typos.Kazu Hirata1-1/+1
* basic-block.h, c-decl.c, c-parse.in, cgraphunit.c, ddg.c, gimplify.c, lambda-code.c, optabs.c, predict.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-loop-ch.c, tree-ssa.c, vec.h: Fix comment typos. Follow spelling conventions. From-SVN: r87637
2004-09-14c-tree.h (struct c_declspecs): Add const_p, volatile_p and restrict_p.Joseph Myers1-58/+93
* c-tree.h (struct c_declspecs): Add const_p, volatile_p and restrict_p. (struct c_declarator): Change u.array.quals and pointer_quals to int. Add u.array.attrs. (quals_from_declspecs): New. * c-decl.c (quals_from_declspecs): New. (shadow_tag_warned): Give more specific message for useless type qualifiers. (build_array_declarator, set_array_declarator_inner, grokdeclarator, make_pointer_declarator, build_null_declspecs, declspecs_add_qual): Update for changed structures. testsuite: * gcc.dg/declspec-12.c: New test. From-SVN: r87500
2004-09-14Fix PR 17408 and PR 17409.Dale Johannesen1-2/+5
From-SVN: r87468
2004-09-13c-decl.c (grokdeclarator): Correct comments about where storage class ↵Joseph Myers1-10/+20
specifiers are rejected by grammar... * c-decl.c (grokdeclarator): Correct comments about where storage class specifiers are rejected by grammar and add corresponding asserts. Diagnose typedefs and parameters declared inline. Change warning for inline main to a pedwarn. Only diagnose inline main if hosted. (declspecs_add_scspec): Allow duplicate "inline". testsuite: * gcc.dg/declspec-7.c: Don't expect diagnostic for duplicate "inline". * gcc.dg/declspec-11.c: Update expected messages. * gcc.dg/inline-6.c, gcc.dg/inline-7.c, gcc.dg/inline-8.c, gcc.dg/inline-9.c, gcc.dg/inline-10.c, gcc.dg/inline-11.c, gcc.dg/inline-12.c: New tests. From-SVN: r87450
2004-09-13c-common.c, [...]: Use %q, %< and %> for quoting in diagnostics.Joseph Myers1-164/+170
* c-common.c, c-decl.c, c-lex.c, c-objc-common.c, c-opts.c, c-parse.in, c-pragma.c, c-typeck.c: Use %q, %< and %> for quoting in diagnostics. Use %' for English apostrophes. * c-tree.h (ATTRIBUTE_GCC_CDIAG): Define. (pedwarn_c90, pedwarn_c99): Use it. * c-decl.c (lookup_label): Quote label name in diagnostic. * c-parse.in (yyprint): Use ' instead of ` for left quote. * c-typeck.c (warn_for_assignment): Likewise. testsuite: * g++.dg/warn/Wswitch-1.C, g++.dg/warn/Wswitch-2.C, gcc.dg/Wswitch-2.c, gcc.dg/Wswitch-enum.c, gcc.dg/Wswitch.c, gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c, gcc.dg/m-un-2.c, gcc.dg/noreturn-1.c, gcc.dg/wtr-conversion-1.c: Update expected messages. From-SVN: r87413
2004-09-11c-tree.h (enum c_storage_class): New.Joseph Myers1-125/+196
* c-tree.h (enum c_storage_class): New. (struct c_declspecs): Add storage_class, inline_p and thread_p. * c-decl.c (shadow_tag_warned): Give errors for "inline" in empty declarations and "auto" or "register" in file scope empty declarations. Give more specific warnings for other cases of storage class specifiers in empty declarations. (grokdeclarator): Update for new structures. Don't check for multiple storage classes. Diagnose file-scope "register" if pedantic. (build_null_declspecs): Update. (declspecs_add_scspec): Update. Diagnose multiple storage class specifiers and invalid uses of "__thread". testsuite: * gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c, gcc.dg/tls/diag-2.c: Update expected messages. * gcc.dg/991209-1.c: Specify compilation options. Update expected messages. * gcc.dg/pr14289-2.c, gcc.dg/pr14289-3.c: Remove. * gcc.dg/declspec-7.c, gcc.dg/declspec-8.c, gcc.dg/declspec-9.c, gcc.dg/declspec-10.c, gcc.dg/declspec-11.c, gcc.dg/tls/diag-4.c, gcc.dg/tls/diag-5.c: New tests. From-SVN: r87374
2004-09-10c-common.h (struct c_fileinfo): Comment moved here from cp-tree.h.Zack Weinberg1-7/+0
* c-common.h (struct c_fileinfo): Comment moved here from cp-tree.h. (extract_interface_info): Delete prototype. * c-decl.c (extract_interface_info): Delete stub. * c-lex.c (get_fileinfo): Initialize file_info_tree here, if it's not already been done ... (init_c_lex): ... not here. (fe_file_change): Don't call extract_interface_info. cp: * cp-tree.h (interface_only, interface_unknown): Delete declarations; comment explaining them moved to c-common.h. * lex.c (interface_only, interface_unknown, extract_interface_info): Delete definitions. (cxx_finish): Don't reset interface_unknown. (handle_pragma_interface): Don't set interface_only and interface_unknown; just the like-named fields in finfo. (handle_pragma_implementation): Adjust comment. * decl2.c (cp_finish_file): Don't reset interface_only and interface_unknown. * method.c (synthesize_method): Don't reset interface_unknown or call extract_interface_info. * pt.c (pop_tinst_level): Don't call extract_interface_info. * decl.c (start_cleanup_fn): Don't save or restore interface_only and interface_unknown. (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename and use the result instead of the interface_only/interface_unknown globals. (start_preparsed_function): Likewise. * lex.c (cxx_make_type): Likewise. * semantics.c (begin_class_definition): Likewise. (expand_body): Don't call extract_interface_info. From-SVN: r87329
2004-09-11c-tree.h (struct c_declspecs): Remove typedef_decl.Joseph Myers1-13/+11
* c-tree.h (struct c_declspecs): Remove typedef_decl. Add typedef_p and typedef_signed_p. * c-decl.c (shadow_tag_warned): Check typedef_p, not typedef_decl. (grokdeclarator): Don't use typedef_decl for warn_deprecated_use. Check typedef_p and typedef_signed_p, not typedef_decl. (grokfield): Check typedef_p, not typedef_decl. (build_null_declspecs): Initialize typedef_p and typedef_signed_p, not typedef_decl. (declspecs_add_type): Set typedef_p and typedef_signed_p, not typedef_decl. testsuite: * gcc.dg/bitfld-9.c: New test. From-SVN: r87326
2004-09-09re PR c/8420 (volatile after the type specifier for an unnamed structure is ↵Joseph Myers1-327/+264
rejected) PR c/8420 * c-tree.h (struct c_declspecs): New. (struct c_declarator, struct c_type_name, struct c_parm): Update element types. (build_array_declarator, grokfield, shadow_tag, shadow_tag_warned, start_function, start_decl, build_c_parm, make_pointer_declarator): Update prototypes. (build_null_declspecs, declspecs_add_qual, declspecs_add_type, declspecs_add_scspec, declspecs_add_attrs): New. (split_specs_attrs): Remove. * c-parse.in (%union): Add dsptype. (declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea, declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea, declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea, declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea, declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea, declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea, declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea, declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea, declspecs_ts, declspecs_nots, declspecs_ts_nosa, declspecs_nots_nosa, declspecs_nosc_ts, declspecs_nosc_nots, declspecs_nosc, declspecs, maybe_type_quals_attrs): Change to dsptype. (struct c_declspec_stack): New. (current_declspecs, declspec_stack): Change type. (PUSH_DECLSPEC_STACK, POP_DECLSPEC_STACK): Update to new structures. (extdefs): Likewise. (setspecs): Likewise. (fndef): Use current_declspecs for empty declspecs list. (declspecs_nosc_nots_nosa_noea, declspecs_nosc_nots_nosa_ea, declspecs_nosc_nots_sa_noea, declspecs_nosc_nots_sa_ea, declspecs_nosc_ts_nosa_noea, declspecs_nosc_ts_nosa_ea, declspecs_nosc_ts_sa_noea, declspecs_nosc_ts_sa_ea, declspecs_sc_nots_nosa_noea, declspecs_sc_nots_nosa_ea, declspecs_sc_nots_sa_noea, declspecs_sc_nots_sa_ea, declspecs_sc_ts_nosa_noea, declspecs_sc_ts_nosa_ea, declspecs_sc_ts_sa_noea, declspecs_sc_ts_sa_ea): Update to new structures and helper functions. Update comments. (typespec_nonattr): Correct comment. (maybe_type_quals_attrs, typename): Update to new structures. * c-decl.c (grokdeclarator, build_array_declarator, grokfield, shadow_tag, shadow_tag_warned, start_function, start_decl, build_c_parm, make_pointer_declarator, set_array_declarator_inner, groktypename): Update to new structures. (build_null_declspecs, declspecs_add_qual, declspecs_add_type, declspecs_add_scspec, declspecs_add_attrs): New. (split_specs_attrs): Remove. (shadow_tag_warned): Make warning for useless type names a pedwarn. Give hard error for long, short, signed, unsigned or _Complex used with struct, union or enum in empty declaration. Make found_tag a bool. (grokdeclarator): Remove checks now done at parse time. testsuite: * gcc.dg/anon-struct-4.c, gcc.dg/declspec-1.c, gcc.dg/declspec-2.c, gcc.dg/declspec-3.c, gcc.dg/declspec-4.c, gcc.dg/declspec-5.c, gcc.dg/declspec-6.c, gcc.dg/long-long-typespec-1.c: New tests. * gcc.dg/tls/diag-2.c: Update expected diagnostics From-SVN: r87218
2004-09-09c-tree.h (enum c_declarator_kind, [...]): New.Joseph Myers1-179/+194
* c-tree.h (enum c_declarator_kind, struct c_arg_info, struct c_declarator, struct c_type_name, struct c_parm): New. (build_array_declarator, set_array_declarator_inner, get_parm_info, grokfield, groktypename, grokparm, push_parm_decl, start_function, start_decl, build_c_parm, build_attrs_declarator, build_function_declarator, make_pointer_declarator, c_cast_expr, store_parm_decls_newstyle, c_expr_sizeof_type): Update prototypes. (build_id_declarator): New. * c-typeck.c (c_cast_expr, c_expr_sizeof_type): Update to new structures. * c-decl.c (ARG_INFO_PARMS, ARG_INFO_TAGS, ARG_INFO_TYPES, ARG_INFO_OTHERS): Remove. (build_id_declarator): New. (build_array_declarator, set_array_declarator_inner, groktypename, start_decl, grokparm, push_parm_decl, grokparms, get_parm_info, grokfield, start_function, store_parm_decls_newstyle, store_parm_decls_oldstyle, store_parm_decls, build_c_parm, build_attrs_declarator, build_function_declarator, make_pointer_declarator, grokdeclarator): Update to new structures. * c-parse.in (%union): Add arginfotype, dtrtype, typenametype and parmtype. (declarator, notype_declarator, after_type_declarator, parm_declarator, parm_declarator_starttypename, parm_declarator_nostarttypename, array_declarator, typename, absdcl, absdcl1, absdcl1_ea, absdcl1_noea, direct_absdcl1, absdcl_maybe_attribute, parm, firstparm, parms, parmlist, parmlist_1, parmlist_2, parmlist_or_identifiers, parmlist_or_identifiers_1): Use these types. (primary, after_type_declarator, parm_declarator_starttypename, notype_declarator, component_decl, component_declarator, component_notype_declarator, typename, absdcl, absdcl_maybe_attribute, absdcl1_ea, direct_absdcl1, parmlist_1, parmlist_2, parmlist_or_identifiers_1): Update to new structures. objc: * objc-act.c (objc_start_function, really_start_method, objc_get_parm_info, start_method_def): Update to new arg_info structures. From-SVN: r87217
2004-09-09c-tree.h (C_DECL_USED, [...]): New.Joseph Myers1-1/+22
* c-tree.h (C_DECL_USED, parser_obstack, in_alignof, in_sizeof, in_typeof, record_maybe_used_decl, pop_maybe_used, c_expr_sizeof_expr, c_expr_sizeof_type): New. * c-decl.c (parser_obstack): New. (c_init_decl_processing): Initialize parser_obstack. (c_write_global_declarations_1): Check for used but undefined static functions. * c-parse.in (%union): Add otype. (save_obstack_position): New. (extdefs): Use it. (unary_expr): Update in_sizeof and in_alignof. Use c_expr_sizeof_expr and c_expr_sizeof_type. (sizeof): Update in_sizeof. (alignof): Update in_alignof. (typeof): Update in_typeof. (typespec_nonreserved_nonattr): Call pop_maybe_used. * c-typeck.c (in_alignof, in_sizeof, in_typeof, struct maybe_used_decl, maybe_used_decls, record_maybe_used_decl, pop_maybe_used, c_expr_sizeof_expr, c_expr_sizeof_type): New. (build_external_ref): Set C_DECL_USED or call record_maybe_used_decl if appropriate. * toplev.c (check_global_declarations): Check TREE_NO_WARNING. testsuite: * gcc.dg/c90-static-1.c, gcc.dg/c99-static-1.c, gcc.dg/gnu99-static-1.c: New tests. From-SVN: r87216
2004-09-08c-decl.c (groktypename_in_parm_context): Remove function.Ziemowit Laski1-12/+0
[gcc/ChangeLog] 2004-09-07 Ziemowit Laski <zlaski@apple.com> * c-decl.c (groktypename_in_parm_context): Remove function. * c-tree.h (groktypename_in_parm_context): Remove prototype. From-SVN: r87169