decaying an array of incomplete type (which has type [0 x i8]*) to a
normal pointer (which has incompletetype*).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135565
91177308-0d34-0410-b5e6-
96231b3b80d8
V = Builder.CreateStructGEP(V, 0, "arraydecay");
}
- return V;
+ // Make sure the array decay ends up being the right type. This matters if
+ // the array type was of an incomplete type.
+ return CGF.Builder.CreateBitCast(V,
+ CGF.getTypes().ConvertTypeForMem(CE->getType()));
}
case CK_FunctionToPointerDecay:
return EmitLValue(E).getAddress();
return &g[1];
}
-}
\ No newline at end of file
+}
+
+namespace PR10395 {
+ struct T;
+ extern T x[];
+ T* f() { return x; }
+}