<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 02/01/2014 02:52, Chandler Carruth
wrote:<br>
</div>
<blockquote
cite="mid:CAGCO0Kh5BEWbf8u3hWs+PCVABvR6VLKqOdoWXA93LP59=gFWZw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jan 1, 2014 at 5:35 PM, Alp
Toker <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">&
is there a reason we're not using the
LLVM_STATIC_ASSERT macro here?<br>
</blockquote>
<br>
</div>
Requires LLVM_ENABLE_CXX11 which isn't yet enabled on most
(any?) of the builders.<br>
<br>
I'd just wait until C++11 and change the lot.</blockquote>
</div>
<br>
Did you check the definition? We provide a fallback if the
compiler doesn't support static_assert.</div>
</div>
</blockquote>
<br>
Sure, in fact I wrote the current definition of LLVM_STATIC_ASSERT
(or at least made the changes adding compiler checks in r198142 and
r198255).<br>
<br>
There is no fallback..<br>
<br>
<code>/// \macro LLVM_STATIC_ASSERT</code><code><br>
</code><code>/// \brief Expands to C/C++'s static_assert on
compilers which support it.</code><code><br>
</code><code>#if __has_feature(cxx_static_assert) || \</code><code><br>
</code><code> defined(__GXX_EXPERIMENTAL_CXX0X__) ||
LLVM_MSC_PREREQ(1600)</code><code><br>
</code><code># define LLVM_STATIC_ASSERT(expr, msg)
static_assert(expr, msg)</code><code><br>
</code><code>#elif __has_feature(c_static_assert)</code><code><br>
</code><code># define LLVM_STATIC_ASSERT(expr, msg)
_Static_assert(expr, msg)</code><code><br>
</code><code>#else</code><code><br>
</code><code># define LLVM_STATIC_ASSERT(expr, msg)</code><code><br>
</code><code>#endif</code><br>
<br>
The macro expands to nothing in the default build configuration:<br>
<br>
<code>lib/Lex/PPMacroExpansion.cpp:
.Case("cxx_static_assert", LangOpts.CPlusPlus11)</code><code><br>
</code><code>
</code><br>
<blockquote
cite="mid:CAGCO0Kh5BEWbf8u3hWs+PCVABvR6VLKqOdoWXA93LP59=gFWZw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"> We also test for support of
static_assert in a more fine grain way than merely that C++11
is enabled which should allow the macro to work on any build
using a modern (last 2 years) Clang host compiler.</div>
</div>
</blockquote>
<br>
Where?<br>
<br>
grep 'static_assert' through the LLVM source tree only finds the
single line above.<br>
<br>
Alp.<br>
<br>
<br>
<blockquote
cite="mid:CAGCO0Kh5BEWbf8u3hWs+PCVABvR6VLKqOdoWXA93LP59=gFWZw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">-Chandler</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.nuanti.com">http://www.nuanti.com</a>
the browser experts
</pre>
</body>
</html>