We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62e9257 commit d412047Copy full SHA for d412047
clang/lib/AST/Interp/Pointer.cpp
@@ -177,6 +177,10 @@ void Pointer::initialize() const {
177
if (isStatic() && Base == 0)
178
return;
179
180
+ // Nothing to do for these.
181
+ if (Desc->getNumElems() == 0)
182
+ return;
183
+
184
InitMapPtr &IM = getInitMap();
185
if (!IM)
186
IM =
clang/test/AST/Interp/arrays.cpp
@@ -566,3 +566,7 @@ char melchizedek[2200000000];
566
typedef decltype(melchizedek[1] - melchizedek[0]) ptrdiff_t;
567
constexpr ptrdiff_t d1 = &melchizedek[0x7fffffff] - &melchizedek[0]; // ok
568
constexpr ptrdiff_t d3 = &melchizedek[0] - &melchizedek[0x80000000u]; // ok
569
570
+/// GH#88018
571
+const int SZA[] = {};
572
+void testZeroSizedArrayAccess() { unsigned c = SZA[4]; }
0 commit comments