[PATCH] D131213: [clang][Headers] Fix unintentional error in D130800
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 5 05:00:34 PDT 2022
aaron.ballman added a comment.
> Undefined macros evaluate to zero, so when checking for a smaller value, we need to include the case when the macro is undefined.
The code being changed already checks `defined(__cplusplus)` so there no undefined macro value being tested. What's more, if `__cplusplus` is not defined, we wouldn't even get into this block because we'd have hit line 19 instead. I think the current form is easier to read given the subsequent comment talking about being in C++98 mode (which would be weird to consider for when `__cplusplus` is not defined), even if the test for `defined(__cplusplus)` isn't strictly needed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131213/new/
https://reviews.llvm.org/D131213
More information about the cfe-commits
mailing list