Do not warn with -Wuninitialized when the member is used in a sizeof or address-of...
[clang.git] / test / Parser / MicrosoftExtensions.c
blob105bb7f3a433132658b3daffa2db96d7682366d5
1 // RUN: %clang_cc1 -triple i386-mingw32 -fsyntax-only -verify -fms-extensions -Wno-unused-value -Wno-missing-declarations -x objective-c++ %s
2 __stdcall int func0();
3 int __stdcall func();
4 typedef int (__cdecl *tptr)();
5 void (*__fastcall fastpfunc)();
6 struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) __declspec(novtable) IUnknown {};
7 extern __declspec(dllimport) void __stdcall VarR4FromDec();
8 __declspec(deprecated) __declspec(deprecated) char * __cdecl ltoa( long _Val, char * _DstBuf, int _Radix);
9 __declspec(noalias) __declspec(restrict) void * __cdecl xxx( void * _Memory );
10 typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR;
11 void * __ptr64 PtrToPtr64(const void *p)
13 return((void * __ptr64) (unsigned __int64) (ULONG_PTR)p );
15 void __forceinline InterlockedBitTestAndSet (long *Base, long Bit)
17 __asm {
18 mov eax, Bit
19 mov ecx, Base
20 lock bts [ecx], eax
21 setc al
25 void *_alloca(int);
27 void foo() {
28 __declspec(align(16)) int *buffer = (int *)_alloca(9);
31 typedef bool (__stdcall __stdcall *blarg)(int);
34 // Charify extension.
35 #define FOO(x) #@x
36 char x = FOO(a);
38 typedef enum E { e1 };
41 void uuidof_test1()
43 __uuidof(0); // expected-error {{you need to include <guiddef.h> before using the '__uuidof' operator}}
46 typedef struct _GUID
48 unsigned long Data1;
49 unsigned short Data2;
50 unsigned short Data3;
51 unsigned char Data4[8];
52 } GUID;
53 struct __declspec(uuid("00000000-0000-0000-3231-000000000046")) A { };
54 struct __declspec(uuid("00000000-0000-0000-1234-000000000047")) B { };
55 class C {};
57 void uuidof_test2()
59 A* a = new A;
60 B b;
61 __uuidof(A);
62 __uuidof(*a);
63 __uuidof(B);
64 __uuidof(&b);
65 _uuidof(0);
67 // FIXME, this must not compile
68 _uuidof(1);
69 // FIXME, this must not compile
70 _uuidof(C);
72 C c;
73 // FIXME, this must not compile
74 _uuidof(c);