194d96291cd041adc5731a2294828a9c20e450b74Douglas Gregortemplate<typename ...Args>
294d96291cd041adc5731a2294828a9c20e450b74Douglas Gregorint f(Args ...args) {
394d96291cd041adc5731a2294828a9c20e450b74Douglas Gregor  return sizeof...(args) + sizeof...(Args);
494d96291cd041adc5731a2294828a9c20e450b74Douglas Gregor}
594d96291cd041adc5731a2294828a9c20e450b74Douglas Gregor
6427964e15f1b9595659cea3fcb4dd808a00f37b5Argyrios Kyrtzidisvoid test() {
7427964e15f1b9595659cea3fcb4dd808a00f37b5Argyrios Kyrtzidis  int a;
8427964e15f1b9595659cea3fcb4dd808a00f37b5Argyrios Kyrtzidis  decltype(a) b;
94ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor
104ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor  typedef int Integer;
114ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor  typedef float Float;
124ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor  typedef bool Bool;
134ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor  bool b2 = __is_trivially_constructible(Integer, Float, Bool);
14427964e15f1b9595659cea3fcb4dd808a00f37b5Argyrios Kyrtzidis}
15427964e15f1b9595659cea3fcb4dd808a00f37b5Argyrios Kyrtzidis
165a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidistypedef int Int;
175a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis
185a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidisclass B {
195a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis virtual void foo(Int);
205a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis};
215a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis
225a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidisclass S : public B {
235a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis  virtual void foo(Int) override;
245a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis};
255a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis
265a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis
27762bb9d0ad20320b9f97a841dce57ba5e8e48b07Richard Smith// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 -fno-delayed-template-parsing -std=c++11 %s | FileCheck %s
2842b2984771a7fd1b17c78bbb2c59fed3db2f1960Douglas Gregor// CHECK: Identifier: "args" [3:20 - 3:24] SizeOfPackExpr=args:2:15
2994d96291cd041adc5731a2294828a9c20e450b74Douglas Gregor// CHECK: Identifier: "Args" [3:38 - 3:42] TypeRef=Args:1:22
30427964e15f1b9595659cea3fcb4dd808a00f37b5Argyrios Kyrtzidis
31762bb9d0ad20320b9f97a841dce57ba5e8e48b07Richard Smith// RUN: c-index-test -test-annotate-tokens=%s:8:1:9:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-DECLTYPE %s
32427964e15f1b9595659cea3fcb4dd808a00f37b5Argyrios Kyrtzidis// CHECK-DECLTYPE: Identifier: "a" [8:12 - 8:13] DeclRefExpr=a:7:7
334ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor
344ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor// RUN: c-index-test -test-annotate-tokens=%s:13:1:14:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-TRAIT %s
354ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor// CHECK-TRAIT: Identifier: "Integer" [13:42 - 13:49] TypeRef=Integer:10:15
364ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor// CHECK-TRAIT: Identifier: "Float" [13:51 - 13:56] TypeRef=Float:11:17
374ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor// CHECK-TRAIT: Identifier: "Bool" [13:58 - 13:62] TypeRef=Bool:12:16
384ca8ac2e61c37ddadf37024af86f3e1019af8532Douglas Gregor
395a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// RUN: c-index-test -test-annotate-tokens=%s:16:1:24:1 -std=c++11 %s | FileCheck -check-prefix=CHECK-WITH-OVERRIDE %s
405a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Keyword: "virtual" [19:2 - 19:9] CXXMethod=foo:19:15 (virtual)
415a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Keyword: "void" [19:10 - 19:14] CXXMethod=foo:19:15 (virtual)
425a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Identifier: "foo" [19:15 - 19:18] CXXMethod=foo:19:15 (virtual)
435a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Punctuation: "(" [19:18 - 19:19] CXXMethod=foo:19:15 (virtual)
445a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Identifier: "Int" [19:19 - 19:22] TypeRef=Int:16:13
455a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Punctuation: ")" [19:22 - 19:23] ParmDecl=:19:22 (Definition)
465a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Punctuation: ";" [19:23 - 19:24] ClassDecl=B:18:7 (Definition)
475a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Keyword: "virtual" [23:3 - 23:10] CXXMethod=foo:23:16 (virtual) [Overrides @19:15]
485a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Keyword: "void" [23:11 - 23:15] CXXMethod=foo:23:16 (virtual) [Overrides @19:15]
495a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Identifier: "foo" [23:16 - 23:19] CXXMethod=foo:23:16 (virtual) [Overrides @19:15]
505a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Punctuation: "(" [23:19 - 23:20] CXXMethod=foo:23:16 (virtual) [Overrides @19:15]
515a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Identifier: "Int" [23:20 - 23:23] TypeRef=Int:16:13
525a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Punctuation: ")" [23:23 - 23:24] ParmDecl=:23:23 (Definition)
535a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Keyword: "override" [23:25 - 23:33] attribute(override)=
545a56e1bdfbf57787314dd44a27318964eaa2cf39Argyrios Kyrtzidis// CHECK-WITH-OVERRIDE: Punctuation: ";" [23:33 - 23:34] ClassDecl=S:22:7 (Definition)
55