Message ID | CAAgBjMkCciA23CXhWTYRGjR+VKP2-9b00KwKN8Fnszr0gGpbEA@mail.gmail.com |
---|---|
State | New |
Headers | show |
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 636e0bb..5dbbea7 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -2389,7 +2389,7 @@ build_indirect_ref (location_t loc, tree ptr, ref_operator errstring) ref = build1 (INDIRECT_REF, t, pointer); - if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE) + if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE && !in_typeof) { if (!C_TYPE_ERROR_REPORTED (TREE_TYPE (ptr))) { diff --git a/gcc/testsuite/gcc.dg/pr44257.c b/gcc/testsuite/gcc.dg/pr44257.c new file mode 100644 index 0000000..9657d2a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr44257.c @@ -0,0 +1,5 @@ +/* { dg-do compile } */ + +struct foo; +struct foo *p; +__typeof (*p) *q;