From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Index/ms-if-exists.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 clang/test/Index/ms-if-exists.cpp (limited to 'clang/test/Index/ms-if-exists.cpp') diff --git a/clang/test/Index/ms-if-exists.cpp b/clang/test/Index/ms-if-exists.cpp new file mode 100644 index 0000000..0815a03 --- /dev/null +++ b/clang/test/Index/ms-if-exists.cpp @@ -0,0 +1,24 @@ +template +void f(T t) { + __if_exists(T::foo) { + { } + t.foo(); + } + + __if_not_exists(T::bar) { + int *i = t; // expected-error{{no viable conversion from 'HasFoo' to 'int *'}} + { } + } +} + +// RUN: c-index-test -test-annotate-tokens=%s:3:1:11:3 -fms-extensions -fno-ms-compatibility -fno-delayed-template-parsing %s | FileCheck %s + +// CHECK: Identifier: "T" [3:15 - 3:16] TypeRef=T:1:19 +// CHECK: Punctuation: "}" [4:7 - 4:8] CompoundStmt= +// CHECK: Identifier: "t" [5:5 - 5:6] DeclRefExpr=t:2:10 +// CHECK: Punctuation: "." [5:6 - 5:7] MemberRefExpr= +// CHECK: Identifier: "foo" [5:7 - 5:10] MemberRefExpr= +// CHECK: Keyword: "int" [9:5 - 9:8] VarDecl=i:9:10 (Definition) +// CHECK: Punctuation: "*" [9:9 - 9:10] VarDecl=i:9:10 (Definition) +// CHECK: Identifier: "i" [9:10 - 9:11] VarDecl=i:9:10 (Definition) +// CHECK: Punctuation: "=" [9:12 - 9:13] VarDecl=i:9:10 (Definition) -- cgit v1.2.3