dexonsmith added inline comments.
================
Comment at: clang/include/clang/AST/APValue.h:405
assert(isInt() && "Invalid accessor");
- return *(APSInt*)(char*)Data.buffer;
+ return *(APSInt *)(char *)&Data;
}
----------------
shafik wrote:
> I notice that in `ASTTypeTraits.h` we use `reinterpret_cast` while here we
> revert to C-style casts.
Yes, this old code probably predates C++11. It'd be nice to fix it, but that
seems out of scope for this patch.
================
Comment at: clang/include/clang/AST/APValue.h:511
assert(isArray() && "Invalid accessor");
- return ((const Arr*)(const void *)Data.buffer)->NumElts;
+ return ((const Arr *)(const void *)&Data)->NumElts;
}
----------------
shafik wrote:
> What is it `char *` in some cases and `void*` in others?
> What is it `char *` in some cases and `void*` in others?
Agreed it's inconsistent! I'd have to guess the original authors here had a
different ideas about which type was more fundamental.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92512/new/
https://reviews.llvm.org/D92512
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits