aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
AgeCommit message (Collapse)AuthorFilesLines
2005-04-05c-decl.c (finish_function): If USE_MAPPED_LOCATION set the location of the ↵Per Bothner1-3/+9
artification 'return 0' in... * c-decl.c (finish_function): If USE_MAPPED_LOCATION set the location of the artification 'return 0' in main() to BUILTINS_LOCATION. * tree-cfg.c (remove_bb): Check that location isn't BUILTINS_LOCATION before warning. From-SVN: r97641
2005-04-01c-decl.c (validate_proto_after_old_defn): Look at TYPE_MAIN_VARIANT of ↵Joseph Myers1-4/+3
argument types. * c-decl.c (validate_proto_after_old_defn): Look at TYPE_MAIN_VARIANT of argument types. testsuite: * gcc.dg/old-style-then-proto-1.c: New test. From-SVN: r97403
2005-03-30re PR c++/772 (Statement expressions issues)Joseph Myers1-0/+17
PR c/772 PR c/17913 * c-tree.h (C_DECL_UNJUMPABLE_STMT_EXPR, C_DECL_UNDEFINABLE_STMT_EXPR, struct c_label_list, struct c_label_context, label_context_stack): New. * c-decl.c (define_label): Check for jumps into statement expressions. Add label to list of defined labels. (start_function): Push context on label_context_stack. (finish_function): Pop context from label_context_stack. * c-typeck.c (label_context_stack): New. (c_finish_goto_label): Check for jumps into statement expressions. Add label to list of jumped to labels. (struct c_switch): Add blocked_stmt_expr. (c_start_case): Initialize it. (do_case): Check it. (c_finish_case): Verify !blocked_stmt_expr. (c_begin_stmt_expr): Push context on label_context_stack. Increment blocked_stmt_expr. Mark labels jumped to from outside as undefinable. (c_finish_stmt_expr): December blocked_stmt_expr. Mark labels defined in the statement expression and no longer jumpable to. Mark labels jumped to from just outside the statement expression as again definable. Pop context from label_context_stack. * doc/extend.texi (Statement Exprs): Update. objc: * objc-act.c (objc_start_function): Push context on label_context_stack. testsuite: * gcc.dg/stmt-expr-label-1.c, gcc.dg/stmt-expr-label-2.c, gcc.dg/stmt-expr-label-3.c : New tests. * gcc.c-torture/execute/medce-2.c: Remove. From-SVN: r97273
2005-03-30re PR c/20368 (internal compiler error: tree check: expected function_type ↵Joseph Myers1-2/+8
or method_type, have integer_type in start_function, at c-decl.c:5777) PR c/20368 * c-decl.c (start_function): Check for old_decl being error_mark_node. testsuite: * gcc.dg/pr20368-1.c, gcc.dg/pr20368-2.c, gcc.dg/pr20368-3.c: New tests. From-SVN: r97270
2005-03-29re PR c/20519 (completed type not selected properly with typeof)Richard Henderson1-80/+14
PR c/20519 * c-decl.c (c_finish_incomplete_decl): Update complete_array_type call. (build_compound_literal): Likewise. Propagate decl type into the initializer. (finish_decl): Likewise. Use new return value from complete_array_type for zero sized arrays. (complete_array_type): Move ... * c-common.c (complete_array_type): ... here. Change first argument to pointer-to-type-node. Consistently use sizetype for the index except for zero sized arrays. Detect zero sized arrays for pedantic mode diagnostics. Create a new type node instead of modifying the old node in place. * c-tree.h (complete_array_type): Move decl ... * c-common.h (complete_array_type): ... here. cp/ * decl.c (cp_complete_array_type): Rename from complete_array_type. Use the new complete_array_type in c-common.c. Update all callers. * cp-tree.h (cp_complete_array_type): Update to match. From-SVN: r97223
2005-03-20c-common.c (handle_aligned_attribute, [...]): Do not strip NOPS from ↵Joseph Myers1-7/+0
INTEGER_CSTs. * c-common.c (handle_aligned_attribute, check_function_sentinel, get_nonnull_operand, handle_sentinel_attribute, check_function_arguments_recurse): Do not strip NOPS from INTEGER_CSTs. * c-decl.c (check_bitfield_type_and_width, build_enumerator): Likewise. * c-format.c (get_constant): Likewise. * c-parser.c (c_parser_postfix_expression): Likewise. * c-typeck.c (set_init_index): Likewise. (convert_arguments): Don't check for NOP_EXPR containing integer constant. From-SVN: r96760
2005-03-20c-decl.c (check_bitfield_type_and_width): Require bit-field width to have ↵Joseph Myers1-2/+4
integer type. * c-decl.c (check_bitfield_type_and_width): Require bit-field width to have integer type. (build_enumerator): Require enumerator value to have integer type. testsuite: * gcc.dg/bitfld-14.c, gcc.dg/enum3.c: New tests. From-SVN: r96755
2005-03-18c-common.c, [...]: Use %D for declarations in diagnostics and %E for ↵Joseph Myers1-25/+17
identifiers, not %s. * c-common.c, c-decl.c, c-format.c, c-typeck.c: Use %D for declarations in diagnostics and %E for identifiers, not %s. From-SVN: r96701
2005-03-14builtin-attrs.def (ATTR_NOVOPS, [...]): New.Zdenek Dvorak1-0/+1
* builtin-attrs.def (ATTR_NOVOPS, ATTR_NOVOPS_LIST, ATTR_PURE_NOTHROW_NOVOPS_LIST): New. * builtins.def (ATTR_MATHFN_FPROUNDING): Use NOVOPS. (BUILT_IN_PREFETCH): Set the NOVOPS attribute. * c-common.c (handle_novops_attribute): New function. (c_common_attribute_table): Add "no vops" entry. * c-decl.c (merge_decls): Copy DECL_IS_NOVOPS. * calls.c (flags_from_decl_or_type): Set ECF_NOVOPS. * tree-ssa-operands.c (get_call_expr_operands): Do not create virtual operands for calls with ECF_NOVOPS flag. * tree.h (DECL_IS_NOVOPS): New macro. (struct tree_decl): Add novops_flag. (ECF_NOVOPS): New constant. From-SVN: r96438
2005-03-13c-decl.c (c_init_decl_processing): Remove useless calls to build_function_type.Kazu Hirata1-6/+0
* c-decl.c (c_init_decl_processing): Remove useless calls to build_function_type. From-SVN: r96370
2005-03-12c-decl.c (c_init_decl_processing): Remove local variables ptr_ftype_void and ↵Kazu Hirata1-5/+3
ptr_ftype_ptr. * c-decl.c (c_init_decl_processing): Remove local variables ptr_ftype_void and ptr_ftype_ptr. From-SVN: r96343
2005-03-11c-tree.h (struct c_declarator): New id_loc field.Per Bothner1-0/+3
* c-tree.h (struct c_declarator): New id_loc field. * c-pragma.h (c_lex_with_flags): Take position reference. * c-lex.c (c_lex_with_flags): Set passed-in location from cpp token, iff USE_MAPPED_LOCATION. (Type doesn't match otherwise.) (c_lex): Pass dummy location to c_lex_with_flags. * c-parser.c (c_lex_one_token): Set c_token's location using c_lex_with_flags, instead of input_location, which might be "ahead". (c_parser_direct_declarator): Set declarator's id_loc from c_token's id_loc. * c-decl.c (grokdeclarator): Set DECL_SOURCE_LOCATION from declarator's id_loc, rather than probably-imprecise input_location. (build_id_declarator): Initialize c_declarator's id_loc field. From-SVN: r96329
2005-03-07Various fixes to allow us to again build if --enable-mapped-location:Per Bothner1-0/+4
* c-decl.c (finish_function): Use SET_EXPR_LOCATION instead of unavailable annotate_with_file_line, if USE_MAPPED_LOCATION. * tree-cfg.c (remove_bb): If USE_MAPPED_LOCATION, change type of local variable loc. Change logic appropriately. * tree-vect-transform.c (vect_finish_stmt_generation): Use EXPR_LOCATION rather than EXPR_LOCUS if USE_MAPPED_LOCATION. * c-parser.c (c_parser_for_statement): Initialize loc variable. * tree.h (DECL_IS_BUILTIN): Temporarily revert definition of DECL_IS_BUILTIN in the USE_MAPPED_LOCATION because of jc1 issues. From-SVN: r96045
2005-03-02re PR c/8927 (Gcc give error for wrong line of C code.)Joseph Myers1-6/+6
PR c/8927 * c-tree.h (undeclared_variable, build_external_ref): Add extra argument. * c-decl.c (undeclared_variable): Take location as argument. * c-typeck.c (build_external_ref): Likewise. * c-parser.c (c_parser_postfix_expression): Pass location of identifier to build_external_ref. testsuite: * gcc.dg/pr8927-1.c: New test. From-SVN: r95773
2005-02-25c-parser.c: New file.Joseph Myers1-1/+8
* c-parser.c: New file. * c-parse.in: Remove. * Makefile.in (c-parse.o-warn, c-parse.o, c-parse.c, c-parse.y): Remove. (c-parser.o): Add dependencies. (C_AND_OBJC_OBJC, C_OBJS, gcc.srcextra, GTFILES, distclean, maintainer-clean, TAGS): Update. * c-config-lang.in (gtfiles): Update. * gengtype-lex.l: Don't handle "@@". * stub-objc.c (objc_get_class_ivars, objc_build_throw_stmt, objc_build_synchronized, objc_begin_try_stmt, objc_begin_catch_clause, objc_finish_catch_clause, objc_build_finally_clause, objc_finish_try_stmt): New. * c-tree.h (struct c_declspecs): Add declspecs_seen_p and type_seen_p. (c_parse_init): Update comment. * c-decl.c (c_init_decl_processing): Update comment. (build_null_declspecs, declspecs_add_qual, declspecs_add_type, declspecs_add_scspec, declspecs_add_attrs): Initialize and update new c_declspecs members. objc: * Make-lang.in (objc/objc-parse.o-warn, objc/objc-parse.o, objc/objc-parse.c, objc/objc-parse.y): Remove (OBJC_OBJS, objc.srcextra, objc.tags, objc.mostlyclean, objc.distclean, objc.maintainer-clean): Update for new parser. * config-lang.in (gtfiles): Update for new parser. testsuite: * gcc.dg/cpp/separate-1.c, gcc.dg/noncompile/971104-1.c, gcc.dg/noncompile/990416-1.c: Adjust expected messages for new parser. From-SVN: r95558
2005-02-03re PR c/17807 (No warning/error for undefined local function.)Joseph Myers1-1/+16
PR c/17807 * c-decl.c (undef_nested_function): New variable. (pop_scope): Diagnose undefined nested functions. (finish_function): Don't attempt cgraph processing or genericizing if current top-level function contained an undefined nested function. Reset undef_nested_function at the end of a top-level function. testsuite: * gcc.dg/nested-func-3.c: New test. * gcc.dg/pr18596-3.c: Expect error for undefined nested function. From-SVN: r94645
2005-02-01re PR c/19333 (C front end accepts arrays of incomplete types)Steven Bosscher1-10/+8
gcc/ PR c/19333 * c-decl.c (start_decl): Do not warn about arrays of elements with an incomplete type here. (grokdeclarator): Do it here by making a pedwarn an error. * c-typeck.c (push_init_level): If there were previous errors with the constructor type, do not warn about braces for initializers. (process_init_element): Likewise for excess initializer elements. testsuite/ PR c/19333 * testsuite/gcc.c-torture/compile/20011130-1.c: Reorder to make the test case valid. * testsuite/gcc.dg/20030815-1.c: Remove invalid tests. * testsuite/gcc.dg/array-7.c: Adjust expected result. * testsuite/gcc.dg/pr18596-3.c: Likewise. * testsuite/gcc.dg/noncompile/20000901-1.c: Likewise. * testsuite/gcc.dg/noncompile/init-2.c: Likewise. * testsuite/gcc.dg/noncompile/init-4.c: Likewise. From-SVN: r94505
2005-01-29c-common.c (fix_string_type): Just use c_build_qualified_type to build ↵Joseph Myers1-28/+15
string type. * c-common.c (fix_string_type): Just use c_build_qualified_type to build string type. (c_build_qualified_type): Build qualified array types with TYPE_MAIN_VARIANT pointing to corresponding unqualified type. * c-decl.c (c_make_fname_decl): Build unqualified array type before qualified type. (grokdeclarator): Use TYPE_MAIN_VARIANT of typedef type if element type is qualified, not just if type itself is. Don't apply qualifiers to array type when declarator is processed. Apply qualifiers to field type whether or not it is an array type. Don't handle array types specially for applying qualifiers to variables. * c-typeck.c (composite_type): Build unqualified element type and array type when forming composite of array types. (common_pointer_type, comptypes, comp_target_types, type_lists_compatible_p, build_indirect_ref, build_array_ref, convert_for_assignment): Don't apply TYPE_MAIN_VARIANT to array types. (type_lists_compatible_p): Cache TREE_VALUE (args1) and TREE_VALUE (args2) in variables a1 and a2. testsuite: * gcc.dg/Wwrite-strings-1.c, gcc.dg/array-quals-2.c, gcc.dg/lvalue-3.c: New tests. * gcc.dg/concat.c: Update expected messages. From-SVN: r94411
2005-01-27re PR c/18946 (ICE in pushdecl)Jakub Jelinek1-7/+17
PR c/18946 * c-decl.c (warn_if_shadowing): Handle old_decl error_mark_node. (pushdecl): Only use DECL_FILE_SCOPE_P if DECL_P. (implicitly_declare): Handle error_mark_node. * gcc.dg/noncompile/20050120-1.c: New test. From-SVN: r94320
2005-01-26For real this time...Richard Henderson1-2/+5
PR middle-end/18008 * c-decl.c (finish_struct): Set DECL_MODE after resetting a field's type. * expr.c (store_field): Strip conversions to odd-bit-sized types if the destination field width matches. From-SVN: r94294
2005-01-26Revert last change.Richard Henderson1-5/+2
From-SVN: r94291
2005-01-26re PR middle-end/18008 (Duplicate mask on bitfield insertion)Richard Henderson1-2/+5
PR middle-end/18008 * c-decl.c (finish_struct): Set DECL_MODE after resetting a field's type. * expmed.c (store_fixed_bit_field): Create a paradoxical subreg if we don't need the bits above those present in the current mode. * expr.c (store_field): Strip conversions to odd-bit-sized types if the destination field width matches. From-SVN: r94290
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