microsoft / clang

Other
199 stars 69 forks source link

Can't compile WinRT application #16

Open altk opened 8 years ago

altk commented 8 years ago

Hello!!! I tried to compile my WinRT application(fully written on C++, not C++/CX) with "CLang 3.7 with Microsoft Codegen (v140_clang_3_7)", but could not. I use Visual Studio 2015 Update 2 with March 2016 CLang. Errors:

  1. C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\winrt\windows.foundation.collections.h(168,10): error : ISO C++ forbids forward references to 'enum' types enum CollectionsChange;
  2. C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\winrt\Windows.Foundation.h(8831,26): error : ISO C++ forbids forward references to 'enum' types typedef enum PropertyType PropertyType;

Another issue produced when compiling template `template struct NOVTABLE RemoveIUnknown abstract : TInterface { static_assert(std::is_base_of<IUnknown, TInterface>::value, "TInterface must inherit IUnknown");

operator TInterface*() NOEXCEPT
{
    return this;
}

private: STDMETHODIMP(ULONG) AddRef(); STDMETHODIMP(ULONG) Release(); STDMETHODIMP QueryTInterface(IID, void **); };`

variable has incomplete type 'struct RemoveIUnknown' RemoveIUnknown abstract : TInterface

There were many others errors, but I think, that listed above are the most interesting.

russellhadley commented 8 years ago

@AndrewPardoe are you minding Clang/C2 right now?

AndrewPardoe commented 8 years ago

Thanks for the report, @altk. We know that WRL is incompatible with our clang settings right now. I believe it will compile with ms-compatibility but as we try to move closer to standard clang defaults stuff in Windows is bound to break.

I've passed this report on to the owners of WRL.