[PATCH] D133934: [clang][Interp] Handle sizeof() expressions
Shafik Yaghmour via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 15 08:41:18 PDT 2022
shafik added inline comments.
================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:290
+ return this->emitConst(
+ E, Ctx.getASTContext().getTypeSizeInChars(ArgType).getQuantity());
+ }
----------------
I notice that `HandleSizeof` special cases `void` and function types.
================
Comment at: clang/test/AST/Interp/literals.cpp:83
+
+namespace SizeOf {
+ constexpr int soint = sizeof(int);
----------------
Test for `void` and a function type too.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133934/new/
https://reviews.llvm.org/D133934
More information about the cfe-commits
mailing list