[PATCH] D133934: [clang][Interp] Handle sizeof() expressions

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 15 08:50:35 PDT 2022


erichkeane requested changes to this revision.
erichkeane added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:290
+    return this->emitConst(
+        E, Ctx.getASTContext().getTypeSizeInChars(ArgType).getQuantity());
+  }
----------------
shafik wrote:
> I notice that `HandleSizeof` special cases `void` and function types. 
OOOH, DEFINITELY make sure you test function types here, and figure out how HandleSizeof does it.

BUT, I think 'void' should error/be an invalid before we get here?

ALSO, now that I think further, I'm sure @aaron.ballman has a bunch of runtime-evaluated sizeof examples to share around vlas.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133934/new/

https://reviews.llvm.org/D133934



More information about the cfe-commits mailing list