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 c9fc960 commit 847d046Copy full SHA for 847d046
clang/lib/AST/Interp/Pointer.h
@@ -513,6 +513,8 @@ class Pointer {
513
unsigned getByteOffset() const {
514
if (isIntegralPointer())
515
return asIntPointer().Value + Offset;
516
+ if (isOnePastEnd())
517
+ return PastEndMark;
518
return Offset;
519
}
520
clang/test/AST/Interp/arrays.cpp
@@ -26,6 +26,9 @@ static_assert(foo[2][2] == nullptr, "");
26
static_assert(foo[2][3] == &m, "");
27
static_assert(foo[2][4] == nullptr, "");
28
29
+constexpr int afterEnd[] = {1,2,3};
30
+static_assert(&afterEnd[3] == afterEnd + 3, "");
31
+
32
constexpr int ZeroSizeArray[] = {};
33
34
constexpr int SomeInt[] = {1};
0 commit comments