summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-31 19:37:45 +0000
committerreichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-31 19:37:45 +0000
commite911c0fee3781613eb99cbed3c6d2d5d9638360c (patch)
treed3592297b0a78fb1d59c1996f7f6c5d09d069b18 /gcc/c-decl.c
parent27f486599a19a5923b58ad522668b34b5c4d956f (diff)
downloadgcc-e911c0fee3781613eb99cbed3c6d2d5d9638360c.tar.gz
PR c/35750
* c-decl.c (store_parm_decls_oldstyle): Skip invalid parameters. * gcc.dg/old-style-param-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133771 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 04b36d50d88..d86bca07be8 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)))