[PATCH] D42561: [PR36008] Avoid -Wsign-compare warning for enum constants in typeof expressions

2018-02-07 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL324514: [PR36008] Avoid -Wsign-compare warning for enum constants in (authored by arphaman, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D42561: [PR36008] Avoid -Wsign-compare warning for enum constants in typeof expressions

2018-02-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM, aside from a minor commenting nit. Comment at: lib/Sema/SemaChecking.cpp:8960 +// Avoid warning about comparison of integers with different signs

[PATCH] D42561: [PR36008] Avoid -Wsign-compare warning for enum constants in typeof expressions

2018-02-05 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 132901. arphaman marked 4 inline comments as done. arphaman added a comment. Herald added a subscriber: jkorous-apple. Address review comments and fix the inverted check case. https://reviews.llvm.org/D42561 Files: lib/Sema/SemaChecking.cpp

[PATCH] D42561: [PR36008] Avoid -Wsign-compare warning for enum constants in typeof expressions

2018-01-26 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/Sema/SemaChecking.cpp:8959 + if (!S.getLangOpts().CPlusPlus) { +if (const TypeOfExprType *TET = dyn_cast(RHS->getType())) + RHS = TET->getUnderlyingExpr()->IgnoreParenImpCasts(); lebedev.ri wrote: >

[PATCH] D42561: [PR36008] Avoid -Wsign-compare warning for enum constants in typeof expressions

2018-01-26 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/SemaChecking.cpp:8959 + if (!S.getLangOpts().CPlusPlus) { +if (const TypeOfExprType *TET = dyn_cast(RHS->getType())) + RHS = TET->getUnderlyingExpr()->IgnoreParenImpCasts(); Please also add a

[PATCH] D42561: [PR36008] Avoid -Wsign-compare warning for enum constants in typeof expressions

2018-01-25 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added a reviewer: lebedev.ri. This patch looks through typeof type at the original expression when diagnosing -Wsign-compare to avoid an unfriendly diagnostic. Repository: rC Clang https://reviews.llvm.org/D42561 Files: lib/Sema/SemaChecking.cpp