[PATCH] D46613: _Atomic of empty struct shouldn't assert

JF Bastien via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 8 20:49:33 PDT 2018


jfb marked an inline comment as done.
jfb added inline comments.


================
Comment at: lib/AST/ASTContext.cpp:1965
+      Width = Target->getCharWidth();
+      Align = Target->getCharWidth();
+    } else if (Width <= Target->getMaxAtomicPromoteWidth()) {
----------------
rjmccall wrote:
> Alignment, unlike size, is definitely never 0.  I think you should leave the original alignment in place; it's a weird case, but we honor over-aligned empty types in a bunch of other places.
Yeah that makes total sense. I turned it to an assert.


Repository:
  rC Clang

https://reviews.llvm.org/D46613





More information about the cfe-commits mailing list