<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div><div class="h5"><div><br></div></div></div><div>See <a href="http://clang.llvm.org/docs/LanguageExtensions.html#feature_check" target="_blank">http://clang.llvm.org/docs/LanguageExtensions.html#feature_check</a> -- it should be completely compiler neutral. </div>
</div></blockquote><div><br></div><div>So, the user code will have to look like this? </div><div><br></div><div>#ifndef __has_feature</div><div># define __has_feature(x) 0</div><div>#endif</div><div>...</div><div><br></div>
<div>#if __has_feature(address_sanitizer)</div><div>..</div><div>#endif</div><div><br></div><div><br></div><div>Also, is that indeed the right use of __has_feature? Maybe __has_extension fits better?  </div><div>Hm, asan is not an extension nor a (C++ standard) feature. </div>
<div><br></div><div><code style="color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">__has_feature</code><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; line-height: 19px; background-color: rgb(255, 255, 255); "> evaluates to 1 if the feature is both supported by Clang and standardized in the current language standard or 0 if not</span></div>
<div><code style="color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">__has_extension</code><span style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; line-height: 19px; background-color: rgb(255, 255, 255); "> evaluates to 1 if the feature is supported by Clang in the current language (either as a language extension or a standard language feature) or 0 if not.</span></div>
<div><br></div><div>--kcc </div><div><br></div><div><br></div><div><br></div><div> </div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div>It's just a mechanism that compilers can use to hide feature tests behind a known-safe macro, thereby avoiding keyword clobbers etc. GCC could be trivially extend to directly support this test pattern, and code can be written to work even with compilers that don't support it. </div>

</div>
</blockquote></div><br>