[PATCH] Enable _Static_assert inside structs/unions in C11 mode

Richard Smith richard at metafoo.co.uk
Wed Mar 27 13:09:27 PDT 2013


+    // Parse _Static_assert declaration.
+    if (Tok.is(tok::kw_static_assert) || Tok.is(tok::kw__Static_assert)) {

Any reason to check for _Static_assert here? This code is not reachable in
C++.

+++ clang/test/Sema/static-assert2.c

Please add the tests to test/Sema/static-assert.c instead. We don't need to
run these tests in C++ mode; we already have good coverage for C++11's
static_assert.

On Wed, Mar 27, 2013 at 9:13 AM, Jordan Rose <jordan_rose at apple.com> wrote:

> It looks like it is not an extension (C11 6.7.2.1p1), so you're good.
>
> I don't see any problems with this but you should wait for someone more
> commonly in Parse than I am.
>
> Jordan
>
>
> On Mar 27, 2013, at 8:14 , Sean Silva <silvas at purdue.edu> wrote:
>
> Adding language extensions should be accompanied by a modification of <
> http://clang.llvm.org/docs/LanguageExtensions.html>
> (clang/docs/LanguageExtensions.rst).
>
> -- Sean Silva
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130327/a94f7178/attachment.html>


More information about the cfe-commits mailing list