diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-17 20:26:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-17 20:26:51 +0000 |
commit | f9088c93be9e51c84d2c1914bf8fb56f9a939271 (patch) | |
tree | b23da9cba9f82885fffa94c76a2845207a787c4d /clang/test/Index/index-templates.cpp | |
parent | f3a9c464b4ff59e691ac631542096b90e9c547a9 (diff) | |
download | bcm5719-llvm-f9088c93be9e51c84d2c1914bf8fb56f9a939271.tar.gz bcm5719-llvm-f9088c93be9e51c84d2c1914bf8fb56f9a939271.zip |
When traversing an InitListExpr, there may not be a syntactic form;
check for NULL and visit the InitListExpr we have if there is no
syntactic form.
llvm-svn: 114203
Diffstat (limited to 'clang/test/Index/index-templates.cpp')
-rw-r--r-- | clang/test/Index/index-templates.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Index/index-templates.cpp b/clang/test/Index/index-templates.cpp index fd0f5ab25d8..b79b4bee4bf 100644 --- a/clang/test/Index/index-templates.cpp +++ b/clang/test/Index/index-templates.cpp @@ -72,6 +72,19 @@ void unresolved_exprs(T &x) { 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 @@ void unresolved_exprs(T &x) { // 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] |