Douglas Gregor | 94d9629 | 2011-01-19 20:34:17 +0000 | [diff] [blame] | 1 | template<typename ...Args> |
| 2 | int f(Args ...args) { |
| 3 | return sizeof...(args) + sizeof...(Args); |
| 4 | } |
| 5 | |
Argyrios Kyrtzidis | 427964e | 2011-08-15 22:40:24 +0000 | [diff] [blame] | 6 | void test() { |
| 7 | int a; |
| 8 | decltype(a) b; |
Douglas Gregor | 4ca8ac2 | 2012-02-24 07:38:34 +0000 | [diff] [blame] | 9 | |
| 10 | typedef int Integer; |
| 11 | typedef float Float; |
| 12 | typedef bool Bool; |
| 13 | bool b2 = __is_trivially_constructible(Integer, Float, Bool); |
Argyrios Kyrtzidis | 427964e | 2011-08-15 22:40:24 +0000 | [diff] [blame] | 14 | } |
| 15 | |
Argyrios Kyrtzidis | 5a56e1b | 2013-02-08 19:27:23 +0000 | [diff] [blame] | 16 | typedef int Int; |
| 17 | |
| 18 | class B { |
| 19 | virtual void foo(Int); |
| 20 | }; |
| 21 | |
| 22 | class S : public B { |
| 23 | virtual void foo(Int) override; |
| 24 | }; |
| 25 | |
| 26 | |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 27 | // RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 -fno-delayed-template-parsing -std=c++11 %s | FileCheck %s |
Douglas Gregor | 42b2984 | 2011-10-05 19:00:14 +0000 | [diff] [blame] | 28 | // CHECK: Identifier: "args" [3:20 - 3:24] SizeOfPackExpr=args:2:15 |
Douglas Gregor | 94d9629 | 2011-01-19 20:34:17 +0000 | [diff] [blame] | 29 | // CHECK: Identifier: "Args" [3:38 - 3:42] TypeRef=Args:1:22 |
Argyrios Kyrtzidis | 427964e | 2011-08-15 22:40:24 +0000 | [diff] [blame] | 30 | |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 31 | // RUN: c-index-test -test-annotate-tokens=%s:8:1:9:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-DECLTYPE %s |
Argyrios Kyrtzidis | 427964e | 2011-08-15 22:40:24 +0000 | [diff] [blame] | 32 | // CHECK-DECLTYPE: Identifier: "a" [8:12 - 8:13] DeclRefExpr=a:7:7 |
Douglas Gregor | 4ca8ac2 | 2012-02-24 07:38:34 +0000 | [diff] [blame] | 33 | |
| 34 | // RUN: c-index-test -test-annotate-tokens=%s:13:1:14:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-TRAIT %s |
| 35 | // CHECK-TRAIT: Identifier: "Integer" [13:42 - 13:49] TypeRef=Integer:10:15 |
| 36 | // CHECK-TRAIT: Identifier: "Float" [13:51 - 13:56] TypeRef=Float:11:17 |
| 37 | // CHECK-TRAIT: Identifier: "Bool" [13:58 - 13:62] TypeRef=Bool:12:16 |
| 38 | |
Argyrios Kyrtzidis | 5a56e1b | 2013-02-08 19:27:23 +0000 | [diff] [blame] | 39 | // RUN: c-index-test -test-annotate-tokens=%s:16:1:24:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-WITH-OVERRIDE %s |
| 40 | // CHECK-WITH-OVERRIDE: Keyword: "virtual" [19:2 - 19:9] CXXMethod=foo:19:15 (virtual) |
| 41 | // CHECK-WITH-OVERRIDE: Keyword: "void" [19:10 - 19:14] CXXMethod=foo:19:15 (virtual) |
| 42 | // CHECK-WITH-OVERRIDE: Identifier: "foo" [19:15 - 19:18] CXXMethod=foo:19:15 (virtual) |
| 43 | // CHECK-WITH-OVERRIDE: Punctuation: "(" [19:18 - 19:19] CXXMethod=foo:19:15 (virtual) |
| 44 | // CHECK-WITH-OVERRIDE: Identifier: "Int" [19:19 - 19:22] TypeRef=Int:16:13 |
| 45 | // CHECK-WITH-OVERRIDE: Punctuation: ")" [19:22 - 19:23] ParmDecl=:19:22 (Definition) |
| 46 | // CHECK-WITH-OVERRIDE: Punctuation: ";" [19:23 - 19:24] ClassDecl=B:18:7 (Definition) |
| 47 | // CHECK-WITH-OVERRIDE: Keyword: "virtual" [23:3 - 23:10] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] |
| 48 | // CHECK-WITH-OVERRIDE: Keyword: "void" [23:11 - 23:15] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] |
| 49 | // CHECK-WITH-OVERRIDE: Identifier: "foo" [23:16 - 23:19] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] |
| 50 | // CHECK-WITH-OVERRIDE: Punctuation: "(" [23:19 - 23:20] CXXMethod=foo:23:16 (virtual) [Overrides @19:15] |
| 51 | // CHECK-WITH-OVERRIDE: Identifier: "Int" [23:20 - 23:23] TypeRef=Int:16:13 |
| 52 | // CHECK-WITH-OVERRIDE: Punctuation: ")" [23:23 - 23:24] ParmDecl=:23:23 (Definition) |
| 53 | // CHECK-WITH-OVERRIDE: Keyword: "override" [23:25 - 23:33] attribute(override)= |
| 54 | // CHECK-WITH-OVERRIDE: Punctuation: ";" [23:33 - 23:34] ClassDecl=S:22:7 (Definition) |