<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 28, 2016 at 12:43 PM, Edward Diener via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Does the clang emulation of the VC++ non-standard preprocessor ever occur when clang ( or clang++ ) are invoked as opposed to clang-cl being invoked ?<br>
<br>
Conversely is the macro _MSC_VER ever predefined when clang ( or clang++ ) are invoked as opposed to clang-cl being invoked ?<br>
<br>
I am hoping the answer to both questions above is 'no', but if it is not I need to know what the exceptions are and why.<br></blockquote><div><br></div><div>Well, the answer to both is "yes". Essentially, the non-standard pre-processor behavior is enabled when clang is targeting an MSVC environment. This can happen if you run 'clang --target=x86_64-windows-msvc', for example. The good news is that _MSC_VER should always be defined when we are doing non-standard things, so you can use that as a feature test.</div><div><br></div><div>It is technically possible for the user to invoke clang in a way that enables MSVC pre-processor quirks without defining _MSC_VER, but that is not expected to work with code in the wild.</div><div><br></div><div>I tried to update or (poor) documentation on our flags here:</div><div><a href="http://clang.llvm.org/docs/UsersManual.html#microsoft-extensions">http://clang.llvm.org/docs/UsersManual.html#microsoft-extensions</a></div><div>It doesn't discuss pre-processor changes, unfortunately. I've forgotten what the even are.</div></div></div></div>