Skip to content

Commit

Permalink
[NFC] Always lock free test: add indirection
Browse files Browse the repository at this point in the history
I have a big patch coming up, and this indirection is required to avoid hitting the following after my big change:

  error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]

llvm-svn: 350772
  • Loading branch information
jfbastien committed Jan 9, 2019
1 parent 569f090 commit 1026ce6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void checkLongLongTypes() {
static_assert((0 != ATOMIC_LLONG_LOCK_FREE) == ExpectLockFree, "");
}

int main()
void run()
{
// structs and unions can't be defined in the template invocation.
// Work around this with a typedef.
Expand Down Expand Up @@ -134,3 +134,5 @@ int main()
static_assert(std::atomic<void*>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE));
static_assert(std::atomic<std::nullptr_t>::is_always_lock_free == (2 == ATOMIC_POINTER_LOCK_FREE));
}

int main() { run(); }

0 comments on commit 1026ce6

Please sign in to comment.