MaybeTypeCast here is not a variable, it's an enum member with value 1.
I'm just not sure if this should be using isTypeCast instead or not. Let's see what the CI says.
Differential D138289
[clang][Parse] Remove constant expression from if condition tbaeder on Nov 18 2022, 5:17 AM. Authored by
Details
MaybeTypeCast here is not a variable, it's an enum member with value 1. I'm just not sure if this should be using isTypeCast instead or not. Let's see what the CI says.
Diff Detail Event TimelineComment Actions This code was introduced in https://github.com/llvm/llvm-project/commit/5a5319062300166a747807339349766341a2c2b2 and does not appear to have had precommit review (that I could find). It was resolving https://bugs.llvm.org/show_bug.cgi?id=23101, and the last comment on that issue suggests this was intending to look at isTypeCast. I expect precommit CI will not care about the removal because it is a no-op change. Comment Actions Precommit CI found that this change breaks clang/test/Sema/PR28181.c which was introduced to fix https://bugs.llvm.org/show_bug.cgi?id=28181 which was a regression caused by https://github.com/llvm/llvm-project/commit/5a5319062300166a747807339349766341a2c2b2 Comment Actions I think for now we can remove the MaybeTypeCast entirely. We only set isTypeCast once we *know* we're dealing with a type cast, and this is about typo correction where we probably don't know what we're dealing with. Given that it's a no-op change to do that, removing it leaves us in no worse shape than we were before. |