If ignored, the subexpr is a UnaryOperator (&) which cannot be evaluated (assertion failed).
#define offsetof(type,memb) ((unsigned long)&((type*)0)->memb)
Differential D144780
Explicit cast on customized offsetof should not be ignored when evaluating as const danix800 on Feb 25 2023, 12:44 AM. Authored by
Details If ignored, the subexpr is a UnaryOperator (&) which cannot be evaluated (assertion failed). #define offsetof(type,memb) ((unsigned long)&((type*)0)->memb)
Diff Detail
Event TimelineComment Actions I love it. Short, to the point. Thanks. Comment Actions As this resolves a crash, I'm backporting it: https://github.com/llvm/llvm-project/issues/61245 |