ckandeler updated this revision to Diff 274071.
ckandeler added a comment.
Fixed formatting issues.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82629/new/
https://reviews.llvm.org/D82629
Files:
clang/test/Index/evaluate-cursor.cpp
clang/tools/libclang/CIndex.cpp
Index: clang/tools/libclang/CIndex.cpp
===================================================================
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -3272,7 +3272,7 @@
}
// Visit init captures
for (auto InitExpr : E->capture_inits()) {
- if (Visit(InitExpr))
+ if (InitExpr && Visit(InitExpr))
return true;
}
Index: clang/test/Index/evaluate-cursor.cpp
===================================================================
--- clang/test/Index/evaluate-cursor.cpp
+++ clang/test/Index/evaluate-cursor.cpp
@@ -29,6 +29,12 @@
constexpr static int calc_val() { return 1 + 2; }
const auto the_value = calc_val() + sizeof(char);
+void vlaTest() {
+ int msize = 4;
+ float arr[msize];
+ [&arr] {};
+}
+
// RUN: c-index-test -evaluate-cursor-at=%s:4:7 \
// RUN: -evaluate-cursor-at=%s:8:7 \
// RUN: -evaluate-cursor-at=%s:8:11 -std=c++11 %s | FileCheck %s
@@ -65,3 +71,7 @@
// CHECK-EXPR: Value: 3
// CHECK-EXPR: unsigned, Value: 4
// CHECK-EXPR: unsigned, Value: 1
+
+// RUN: c-index-test -evaluate-cursor-at=%s:35:5 \
+// RUN: -std=c++11 %s | FileCheck -check-prefix=VLA %s
+// VLA: Not Evaluatable
Index: clang/tools/libclang/CIndex.cpp
===================================================================
--- clang/tools/libclang/CIndex.cpp
+++ clang/tools/libclang/CIndex.cpp
@@ -3272,7 +3272,7 @@
}
// Visit init captures
for (auto InitExpr : E->capture_inits()) {
- if (Visit(InitExpr))
+ if (InitExpr && Visit(InitExpr))
return true;
}
Index: clang/test/Index/evaluate-cursor.cpp
===================================================================
--- clang/test/Index/evaluate-cursor.cpp
+++ clang/test/Index/evaluate-cursor.cpp
@@ -29,6 +29,12 @@
constexpr static int calc_val() { return 1 + 2; }
const auto the_value = calc_val() + sizeof(char);
+void vlaTest() {
+ int msize = 4;
+ float arr[msize];
+ [&arr] {};
+}
+
// RUN: c-index-test -evaluate-cursor-at=%s:4:7 \
// RUN: -evaluate-cursor-at=%s:8:7 \
// RUN: -evaluate-cursor-at=%s:8:11 -std=c++11 %s | FileCheck %s
@@ -65,3 +71,7 @@
// CHECK-EXPR: Value: 3
// CHECK-EXPR: unsigned, Value: 4
// CHECK-EXPR: unsigned, Value: 1
+
+// RUN: c-index-test -evaluate-cursor-at=%s:35:5 \
+// RUN: -std=c++11 %s | FileCheck -check-prefix=VLA %s
+// VLA: Not Evaluatable
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits