summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/Core/index-source.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-08-03 05:38:53 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2016-08-03 05:38:53 +0000
commitf60c395e84781f4842c416b3aede32be6d90eed7 (patch)
tree3bf10dcdab9b0dac34693ddecd99b0c3034bf924 /clang/test/Index/Core/index-source.cpp
parent2219d157481d0b253f00c5dd10b154a1b2743431 (diff)
downloadbcm5719-llvm-f60c395e84781f4842c416b3aede32be6d90eed7.tar.gz
bcm5719-llvm-f60c395e84781f4842c416b3aede32be6d90eed7.zip
[index] Fix crash with indexing designated init expressions inside templates.
rdar://27452869 llvm-svn: 277570
Diffstat (limited to 'clang/test/Index/Core/index-source.cpp')
-rw-r--r--clang/test/Index/Core/index-source.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Index/Core/index-source.cpp b/clang/test/Index/Core/index-source.cpp
index 75c6396da55..c4e12903f6c 100644
--- a/clang/test/Index/Core/index-source.cpp
+++ b/clang/test/Index/Core/index-source.cpp
@@ -7,3 +7,15 @@ class TemplCls {
// CHECK: [[@LINE-1]]:3 | constructor/C++ | TemplCls | c:@ST>1#T@TemplCls@F@TemplCls#I# | <no-cgname> | Decl,RelChild | rel: 1
// CHECK-NEXT: RelChild | TemplCls | c:@ST>1#T@TemplCls
};
+
+template <typename T>
+class BT {
+ struct KLR {
+ int idx;
+ };
+
+ // CHECK: [[@LINE+1]]:7 | instance-method/C++ | foo |
+ KLR foo() {
+ return { .idx = 0 }; // Make sure this doesn't trigger a crash.
+ }
+};
OpenPOWER on IntegriCloud