Skip to content

Commit 880889f

Browse files
committed
Add test for constexpr unknown value
1 parent 89b0e78 commit 880889f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

clang/test/AST/ast-dump-APValue-lvalue.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct F {
2323
};
2424
F f;
2525

26-
void Test() {
26+
void Test(int (&arr)[10]) {
2727
constexpr int *pi = &i;
2828
// CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} pi 'int *const' constexpr cinit
2929
// CHECK-NEXT: | |-value: LValue Base=VarDecl {{.*}}, Null=0, Offset=0, HasPath=1, PathLength=0, Path=()
@@ -44,6 +44,10 @@ void Test() {
4444
// CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} pf 'char *const' constexpr cinit
4545
// CHECK-NEXT: | |-value: LValue Base=VarDecl {{.*}}, Null=0, Offset=2, HasPath=1, PathLength=2, Path=({{.*}}, 2)
4646

47+
constexpr const int *parr = arr + 10;
48+
// CHECK: | `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} parr 'char *const' constexpr cinit
49+
// CHECK-NEXT: | |-value: LValue Base=VarDecl {{.*}}, Null=0, Offset=41, HasPath=0
50+
4751
constexpr const int *n = nullptr;
4852
// CHECK: `-VarDecl {{.*}} <col:{{.*}}, col:{{.*}}> col:{{.*}} n 'const int *const' constexpr cinit
4953
// CHECK-NEXT: |-value: LValue Base=null, Null=1, Offset=0, HasPath=1, PathLength=0, Path=()

0 commit comments

Comments
 (0)