[Solved] Build error when using Visual Studio 2019 with Clang compiler

I’ve recently switched from VS2017 to VS2019 and since it now has built-in support for Clang, I tried to build one of my plug-ins using it, but is failing to compile because of 2 errors:

1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\deque(872,50): error : no matching function for call to ‘exchange’
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\yvals_core.h(1135,20): message : expanded from macro ‘_STD’
1>D:\Development\cpp\ignite\projects\windows\visualstudio\VST…\SDKs\VST3_SDK\base/source/updatehandler.cpp(154,8): message : in instantiation of member function ‘std::deque<Steinberg::Update::UpdateData, std::allocatorSteinberg::Update::UpdateData >::~deque’ requested here
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\utility(570,18): message : candidate template ignored: substitution failure [with _Ty = std::_Container_proxy *, _Other = int]



1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\utility(574,20): error : assigning to ‘std::_Container_proxy *’ from incompatible type ‘int’
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include\deque(872,55): message : in instantiation of function template specialization ‘std::exchange<std::_Container_proxy *, int>’ requested here
1>D:\Development\cpp\ignite\projects\windows\visualstudio\VST…\SDKs\VST3_SDK\base/source/updatehandler.cpp(154,8): message : in instantiation of member function ‘std::deque<Steinberg::Update::DeferedChange, std::allocatorSteinberg::Update::DeferedChange >::~deque’ requested here

Everything is fine using the Microsoft VS compiler and oddly enough even using the LLVM Compiler Toolchain:
https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.llvm-toolchain

so this seems to only be related to the VS2019 built-in implementation.

Any chance for a fix in the future updates?
I’ve tested the VST3 SDK v3.6.12 and 3.6.14 and both have the same issue.

Regards,
Federico

For me this looks more like a problem of the compiler and I cannot think of a fix we could apply. But if you have an idea what needs to be changed, you’re welcome to propose it.

Nevermind, ended up being related to one of my macro definitions, my bad.
It compiles fine now, sorry. :blush: