[llvm-branch-commits] [cfe-branch] r114213 - in /cfe/branches/Apple/whitney-IB/src/tools/clang: ./ test/Index/index-templates.cpp tools/libclang/CIndex.cpp
Daniel Dunbar
daniel at zuster.org
Fri Sep 17 14:28:51 PDT 2010
Author: ddunbar
Date: Fri Sep 17 16:28:51 2010
New Revision: 114213
URL: http://llvm.org/viewvc/llvm-project?rev=114213&view=rev
Log:
ddunbar at lordcrumb:whitney-IB$ svn merge -c 114203 https://llvm.org/svn/llvm-project/cfe/trunk src/tools/clang
--- Merging r114203 into 'src/tools/clang':
U src/tools/clang/test/Index/index-templates.cpp
U src/tools/clang/tools/libclang/CIndex.cpp
Modified:
cfe/branches/Apple/whitney-IB/src/tools/clang/ (props changed)
cfe/branches/Apple/whitney-IB/src/tools/clang/test/Index/index-templates.cpp
cfe/branches/Apple/whitney-IB/src/tools/clang/tools/libclang/CIndex.cpp
Propchange: cfe/branches/Apple/whitney-IB/src/tools/clang/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 17 16:28:51 2010
@@ -1,2 +1,2 @@
-/cfe/trunk:114070,114075,114145
+/cfe/trunk:114070,114075,114145,114203
/llvm/branches/Apple/Pertwee/tools/clang:110850,110961
Modified: cfe/branches/Apple/whitney-IB/src/tools/clang/test/Index/index-templates.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/tools/clang/test/Index/index-templates.cpp?rev=114213&r1=114212&r2=114213&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/tools/clang/test/Index/index-templates.cpp (original)
+++ cfe/branches/Apple/whitney-IB/src/tools/clang/test/Index/index-templates.cpp Fri Sep 17 16:28:51 2010
@@ -72,6 +72,19 @@
swap<T>(x, x);
}
+template<typename T, U>
+struct Pair {
+ T first;
+ U second;
+};
+
+template<typename T, typename U>
+void init_list(T t, U u) {
+ typedef U second_type;
+
+ Pair<T, U> p = { t, second_type(u) };
+}
+
// RUN: c-index-test -test-load-source all %s | FileCheck -check-prefix=CHECK-LOAD %s
// CHECK-LOAD: index-templates.cpp:4:6: FunctionTemplate=f:4:6 Extent=[3:1 - 4:22]
// CHECK-LOAD: index-templates.cpp:3:19: TemplateTypeParameter=T:3:19 (Definition) Extent=[3:19 - 3:20]
@@ -140,6 +153,11 @@
// CHECK-LOAD: index-templates.cpp:69:3: OverloadedDeclRef=swap[60:6, 59:39, 58:27]
// CHECK-LOAD: index-templates.cpp:71:6: OverloadedDeclRef=f[63:7, 64:9]
// CHECK-LOAD: index-templates.cpp:72:3: OverloadedDeclRef=swap[58:27, 59:39]
+// CHECK-LOAD: index-templates.cpp:82:6: FunctionTemplate=init_list:82:6 (Definition)
+// CHECK-LOAD: index-templates.cpp:85:14: VarDecl=p:85:14 (Definition) Extent=[85:14 - 85:39]
+// CHECK-LOAD: index-templates.cpp:85:20: DeclRefExpr=t:82:18 Extent=[85:20 - 85:21]
+// CHECK-LOAD: index-templates.cpp:85:23: TypeRef=second_type:83:13 Extent=[85:23 - 85:34]
+// CHECK-LOAD: index-templates.cpp:85:35: DeclRefExpr=u:82:23 Extent=[85:35 - 85:36]
// RUN: c-index-test -test-load-source-usrs all %s | FileCheck -check-prefix=CHECK-USRS %s
// CHECK-USRS: index-templates.cpp c:@FT@>3#T#Nt0.0#t>2#T#Nt1.0f#>t0.22t0.0# Extent=[3:1 - 4:22]
Modified: cfe/branches/Apple/whitney-IB/src/tools/clang/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney-IB/src/tools/clang/tools/libclang/CIndex.cpp?rev=114213&r1=114212&r2=114213&view=diff
==============================================================================
--- cfe/branches/Apple/whitney-IB/src/tools/clang/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/Apple/whitney-IB/src/tools/clang/tools/libclang/CIndex.cpp Fri Sep 17 16:28:51 2010
@@ -1663,7 +1663,10 @@
bool CursorVisitor::VisitInitListExpr(InitListExpr *E) {
// We care about the syntactic form of the initializer list, only.
- return VisitExpr(E->getSyntacticForm());
+ if (InitListExpr *Syntactic = E->getSyntacticForm())
+ return VisitExpr(Syntactic);
+
+ return VisitExpr(E);
}
bool CursorVisitor::VisitDesignatedInitExpr(DesignatedInitExpr *E) {
More information about the llvm-branch-commits
mailing list