[PATCH] D46112: Allow _Atomic to be specified on incomplete types
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 26 12:42:09 PDT 2018
efriedma added a comment.
This generally makes sense.
Need some tests to make sure we emit an appropriate error if you try to actually use atomic operators (load/store) or intrinsics (__atomic_is_lock_free etc.) with an incomplete type. And a test that code generation emits something appropriate.
================
Comment at: lib/Sema/SemaType.cpp:8022
+ else if (LangOpts.CPlusPlus && isCompleteType(Loc, T) &&
+ !T.isTriviallyCopyableType(Context))
// Some other non-trivially-copyable type (probably a C++ class)
----------------
If you're going to allow incomplete types in C++, you'll need some code to handle the case where the type is initially incomplete, but completed later.
https://reviews.llvm.org/D46112
More information about the cfe-commits
mailing list