This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/62024] __atomic_always_lock_free is not a constant expression


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...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]