diff options
author | Volker Reichelt <v.reichelt@netcologne.de> | 2008-03-31 19:37:45 +0000 |
---|---|---|
committer | Volker Reichelt <reichelt@gcc.gnu.org> | 2008-03-31 19:37:45 +0000 |
commit | bb686a19e90ef34eb921e116dcf81a25aaa02cb4 (patch) | |
tree | d3592297b0a78fb1d59c1996f7f6c5d09d069b18 /gcc/c-decl.c | |
parent | dec55d763c498096e4f8211e212c8b0631829ce6 (diff) | |
download | gcc-bb686a19e90ef34eb921e116dcf81a25aaa02cb4.zip gcc-bb686a19e90ef34eb921e116dcf81a25aaa02cb4.tar.gz gcc-bb686a19e90ef34eb921e116dcf81a25aaa02cb4.tar.bz2 |
re PR c/35750 (ICE with invalid old-style parameter declaration)
PR c/35750
* c-decl.c (store_parm_decls_oldstyle): Skip invalid parameters.
* gcc.dg/old-style-param-1.c: New test.
From-SVN: r133771
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 04b36d5..d86bca0 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6483,8 +6483,10 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) /* Type for passing arg must be consistent with that declared for the arg. ISO C says we take the unqualified type for parameters declared with qualified type. */ - if (!comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)), - TYPE_MAIN_VARIANT (TREE_VALUE (type)))) + if (TREE_TYPE (parm) != error_mark_node + && TREE_TYPE (type) != error_mark_node + && !comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)), + TYPE_MAIN_VARIANT (TREE_VALUE (type)))) { if (TYPE_MAIN_VARIANT (TREE_TYPE (parm)) == TYPE_MAIN_VARIANT (TREE_VALUE (type))) |