annotate clang/test/Index/ms-if-exists.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 template<typename T>
anatofuz
parents:
diff changeset
2 void f(T t) {
anatofuz
parents:
diff changeset
3 __if_exists(T::foo) {
anatofuz
parents:
diff changeset
4 { }
anatofuz
parents:
diff changeset
5 t.foo();
anatofuz
parents:
diff changeset
6 }
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 __if_not_exists(T::bar) {
anatofuz
parents:
diff changeset
9 int *i = t; // expected-error{{no viable conversion from 'HasFoo' to 'int *'}}
anatofuz
parents:
diff changeset
10 { }
anatofuz
parents:
diff changeset
11 }
anatofuz
parents:
diff changeset
12 }
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 // RUN: c-index-test -test-annotate-tokens=%s:3:1:11:3 -fms-extensions -fno-ms-compatibility -fno-delayed-template-parsing %s | FileCheck %s
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 // CHECK: Identifier: "T" [3:15 - 3:16] TypeRef=T:1:19
anatofuz
parents:
diff changeset
17 // CHECK: Punctuation: "}" [4:7 - 4:8] CompoundStmt=
anatofuz
parents:
diff changeset
18 // CHECK: Identifier: "t" [5:5 - 5:6] DeclRefExpr=t:2:10
anatofuz
parents:
diff changeset
19 // CHECK: Punctuation: "." [5:6 - 5:7] MemberRefExpr=
anatofuz
parents:
diff changeset
20 // CHECK: Identifier: "foo" [5:7 - 5:10] MemberRefExpr=
anatofuz
parents:
diff changeset
21 // CHECK: Keyword: "int" [9:5 - 9:8] VarDecl=i:9:10 (Definition)
anatofuz
parents:
diff changeset
22 // CHECK: Punctuation: "*" [9:9 - 9:10] VarDecl=i:9:10 (Definition)
anatofuz
parents:
diff changeset
23 // CHECK: Identifier: "i" [9:10 - 9:11] VarDecl=i:9:10 (Definition)
anatofuz
parents:
diff changeset
24 // CHECK: Punctuation: "=" [9:12 - 9:13] VarDecl=i:9:10 (Definition)