<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Mar 17, 2014, at 2:53 PM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">I seem to recall someone suggesting that we move away from using __has_feature for these checks.</div></blockquote><div><br></div>If you mean the discussion between you, Aaron, and Alp - then yes, I recall it too.</div><div>But it seemed to peter out w/o a resolution.</div><div><br></div><div>I’m not wedded to this approach; but I would like to be able to tell if a compiler supports __is_constructible(Foo).</div><div>I believe that the “current way” is to check using __has_feature(is_constructible), but I’m open to other methods.</div><div><br></div><div>— Marshall</div><div><br></div><div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 17, 2014 at 1:36 PM, Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Note: Clang already implements “__is_constructible” - this just makes it checkable.<br>
With this check I can use it in libc++.<br>
<br>
— Marshall<br>
<br>
<br>
Index: lib/Lex/PPMacroExpansion.cpp<br>
===================================================================<br>
--- lib/Lex/PPMacroExpansion.cpp        (revision 204039)<br>
+++ lib/Lex/PPMacroExpansion.cpp        (working copy)<br>
@@ -989,6 +989,7 @@<br>
            .Case("is_sealed", LangOpts.MicrosoftExt)<br>
            .Case("is_trivial", LangOpts.CPlusPlus)<br>
            .Case("is_trivially_assignable", LangOpts.CPlusPlus)<br>
+           .Case("is_constructible", LangOpts.CPlusPlus)<br>
            .Case("is_trivially_constructible", LangOpts.CPlusPlus)<br>
            .Case("is_trivially_copyable", LangOpts.CPlusPlus)<br>
            .Case("is_union", LangOpts.CPlusPlus)<br>
Index: test/Lexer/has_feature_type_traits.cpp<br>
===================================================================<br>
--- test/Lexer/has_feature_type_traits.cpp      (revision 204039)<br>
+++ test/Lexer/has_feature_type_traits.cpp      (working copy)<br>
@@ -100,6 +100,11 @@<br>
 #endif<br>
 // CHECK: int is_standard_layout();<br>
<br>
+#if __has_feature(is_constructible)<br>
+int is_constructible();<br>
+#endif<br>
+// CHECK: int is_constructible();<br>
+<br>
 #if __has_feature(is_trivially_copyable)<br>
 int is_trivially_copyable();<br>
 #endif<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div></div>
</blockquote></div><br></body></html>