On Fri, Jul 19, 2013 at 4:18 PM, Gao, Yunzhong <span dir="ltr"><<a href="mailto:yunzhong_gao@playstation.sony.com" target="_blank">yunzhong_gao@playstation.sony.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Hi,<br>
When compiling the following test program on my Ubuntu machine, I get a compile-time error:<br>
<br>
/* test.c */<br>
#if __has_feature(c_static_assert)<br>
#pragma message("HAS_STATIC_ASSERT")<br>
#else<br>
_Static_assert(1==0,"");  // if there is no static assert support<br>
#endif<br>
/* end of test.c */<br>
<br>
$ install/bin/clang -S -o - test.c<br>
test.c:4:1: error: static_assert failed ""<br>
_Static_assert(1==0,"");<br>
^              ~~~~<br>
1 error generated.<br>
<br>
Since __has_feature(c_static_assert) is false, I would not expect _Static_assert() to be enabled here. Should I file a clang bug?<br></div></div></blockquote><div><br></div><div>No; we support _Static_assert as an extension. See __has_extension(c_static_assert).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="direction:ltr;font-size:10pt;font-family:Tahoma">
Thanks,<br>
- Gao.<br>
</div>
</div>

<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br>