[PATCH] D46112: Allow _Atomic to be specified on incomplete types

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 31 15:32:32 PDT 2018


efriedma added a comment.

If you don't want to spend too much time on C++, fine; could you add a short Objective-C test instead to make sure the trivially-copyable checks are working?

What are the changes to Sema::RequireCompleteTypeImpl supposed to do?



================
Comment at: test/Sema/atomic-type.c:30
+  int i;
+  (void)__atomic_load(addr, &i, 5); // expected-error {{address argument to atomic operation must be a pointer to a trivially-copyable type ('_Atomic(void) *' invalid)}}
+  (void)__c11_atomic_load(addr, 5); // expected-error {{invalid use of incomplete type 'void'}}
----------------
This error message is terrible; yes, technically 'void' isn't trivially copyable, but that isn't really helpful.


https://reviews.llvm.org/D46112





More information about the cfe-commits mailing list