This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/62024] __atomic_always_lock_free is not a constant expression
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 13 Aug 2014 06:07:44 +0000
- Subject: [Bug c/62024] __atomic_always_lock_free is not a constant expression
- Auto-submitted: auto-generated
- References: <bug-62024-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62024
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Amanieu d'Antras from comment #2)
> int array[__atomic_always_lock_free(sizeof(int), 0)];
>
> test.c:1:5: error: variably modified âarrayâ at file scope
I think it should be fine to reject this one - the array size is not an integer
constant expression. While the first argument of _Static_assert also has to be
an integer constant expression, I thought we could permit some latitude here;
the _Static_assert (__atomic_always_lock_free (sizeof (int), 0), "foo"); line
looks quite reasonable to me...