[clang] [clang] Fix 71315698c9 in presence of incomplete types (PR #114095)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 12:47:06 PDT 2024


================
@@ -8900,7 +8900,8 @@ void Sema::CheckMemaccessArguments(const CallExpr *Call,
           << Call->getCallee()->getSourceRange());
     else if (const auto *RT = PointeeTy->getAs<RecordType>()) {
 
-      bool IsTriviallyCopyableCXXRecord =
+      bool MayBeTriviallyCopyableCXXRecord =
+          RT->isIncompleteType() ||
----------------
AaronBallman wrote:

> Something along those lines?
> 
> ```
> FIXME: Do not consider incomplete type even though they may be completed later.
> ```

I'd prefer something more like:
```
FIXME: Do not consider incomplete types even though they may be completed later. GCC does
not diagnose such code, but we may want to consider diagnosing it in the future, perhaps under
a different, but related, diagnostic group.
```
so it's more clear why it's a fixme. But yeah, I can live with that.

https://github.com/llvm/llvm-project/pull/114095


More information about the cfe-commits mailing list