You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/test/Sema/const-eval.c
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -140,10 +140,10 @@ EVAL_EXPR(52, &pr24622 == (void *)&PR24622); // expected-error {{must have a con
140
140
141
141
// We evaluate these by providing 2s' complement semantics in constant
142
142
// expressions, like we do for integers.
143
-
void*PR28739a= (__int128)(unsigned long)-1+&PR28739a;// expected-warning {{the pointer incremented by 18446744073709551615 refers past the last possible element for an array in 64-bit address space containing 64-bit (8-byte) elements (max possible 2305843009213693952 elements)}}
144
-
void*PR28739b=&PR28739b+ (__int128)(unsigned long)-1;// expected-warning {{refers past the last possible element}}
145
-
__int128PR28739c= (&PR28739c+ (__int128)(unsigned long)-1) -&PR28739c;// expected-warning {{refers past the last possible element}}
146
-
void*PR28739d=&(&PR28739d)[(__int128)(unsigned long)-1];// expected-warning {{refers past the last possible element}}
Copy file name to clipboardExpand all lines: clang/test/SemaCXX/constant-expression-cxx1y.cpp
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1018,9 +1018,8 @@ constexpr int S = sum(Cs); // expected-error{{must be initialized by a constant
1018
1018
}
1019
1019
1020
1020
constexprvoidPR28739(int n) { // expected-error {{never produces a constant}}
1021
-
int *p = &n;// expected-note {{declared here}}
1021
+
int *p = &n;
1022
1022
p += (__int128)(unsignedlong)-1; // expected-note {{cannot refer to element 18446744073709551615 of non-array object in a constant expression}}
1023
-
// expected-warning@-1 {{the pointer incremented by 18446744073709551615 refers past the last possible element for an array in 64-bit address space containing 32-bit (4-byte) elements (max possible 4611686018427387904 elements)}}
0 commit comments