aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/function.cc3
-rw-r--r--gcc/testsuite/gcc.dg/redecl-22.c9
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/function.cc b/gcc/function.cc
index 361aa5f..9c8773b 100644
--- a/gcc/function.cc
+++ b/gcc/function.cc
@@ -2090,6 +2090,9 @@ aggregate_value_p (const_tree exp, const_tree fntype)
if (VOID_TYPE_P (type))
return 0;
+ if (error_operand_p (fntype))
+ return 0;
+
/* If a record should be passed the same as its first (and only) member
don't pass it as an aggregate. */
if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type))
diff --git a/gcc/testsuite/gcc.dg/redecl-22.c b/gcc/testsuite/gcc.dg/redecl-22.c
new file mode 100644
index 0000000..7758570f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/redecl-22.c
@@ -0,0 +1,9 @@
+/* We used to ICE in the gimplifier, PR 107705 */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+int f (void)
+{
+ int (*p) (void) = 0; // { dg-note "" }
+ return p ();
+ int p = 1; // { dg-error "" }
+}