[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / ms-iunknown-template-function.cpp
blob8f741a18eaacd6ca648a12c8ad8f9aa582f3f7b3
1 // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
2 // expected-no-diagnostics
3 typedef long HRESULT;
4 typedef unsigned long ULONG;
5 typedef struct _GUID {
6 unsigned long Data1;
7 unsigned short Data2;
8 unsigned short Data3;
9 unsigned char Data4[8];
10 } GUID;
11 typedef GUID IID;
13 // remove stdcall, since the warnings have nothing to do with
14 // what is being tested.
15 #define __stdcall
17 extern "C" {
18 extern "C++" {
19 struct __declspec(uuid("00000000-0000-0000-C000-000000000046"))
20 IUnknown {
21 public:
22 virtual HRESULT __stdcall QueryInterface(
23 const IID &riid,
24 void **ppvObject) = 0;
26 virtual ULONG __stdcall AddRef(void) = 0;
28 virtual ULONG __stdcall Release(void) = 0;
30 template <class Q>
31 HRESULT __stdcall QueryInterface(Q **pp) {
32 return QueryInterface(__uuidof(Q), (void **)pp);
38 __interface ISfFileIOPropertyPage : public IUnknown{};