[clang] [clang][ExtractAPI] fix a couple crashes when used via libclang (PR #132297)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 26 11:52:16 PDT 2025
================
@@ -0,0 +1,41 @@
+// Test is line- and column-sensitive. Run lines are below
+
+template <typename T>
+class basic_vector {
+public:
+ T x;
+ T y;
+};
+
+using my_vec = basic_vector<int>;
+
+class MyClass {
+ my_vec myVec;
+};
+
+struct OuterStruct {
+ struct InnerStruct;
+ int outer_field;
+};
+
+// RUN: c-index-test -single-symbol-sgf-at=%s:13:7 local %s | FileCheck --check-prefix=CHECK-VEC-TYPE %s
+// CHECK-VEC-TYPE: "parentContexts":[{"kind":"c++.typealias","name":"my_vec","usr":"c:@my_vec"}]
+// CHECK-VEC-TYPE: "declarationFragments":[{"kind":"keyword","spelling":"typedef"},{"kind":"text","spelling":" "},{"kind":"typeIdentifier","preciseIdentifier":"c:@ST>1#T at basic_vector","spelling":"basic_vector"},{"kind":"text","spelling":"<"},{"kind":"typeIdentifier","preciseIdentifier":"c:I","spelling":"int"},{"kind":"text","spelling":"> "},{"kind":"identifier","spelling":"my_vec"},{"kind":"text","spelling":";"}]
----------------
QuietMisdreavus wrote:
Right, i agree that this is good, but we should track that separately.
https://github.com/llvm/llvm-project/pull/132297
More information about the cfe-commits
mailing list