This is an archive of the discontinued LLVM Phabricator instance.

[PR36008] Avoid -Wsign-compare warning for enum constants in typeof expressions
ClosedPublic

Authored by arphaman on Jan 25 2018, 4:32 PM.

Diff Detail

Repository
rC Clang

Event Timeline

arphaman created this revision.Jan 25 2018, 4:32 PM
lebedev.ri edited the summary of this revision. (Show Details)Jan 26 2018, 2:33 AM
lebedev.ri added a project: Restricted Project.
lebedev.ri added inline comments.
lib/Sema/SemaChecking.cpp
8959

Please also add a comment what this is trying to solve.

test/Sema/compare.c
404

Can you also add the swapped test:

if (y == x) x = y; // no warning
aaron.ballman added inline comments.Jan 26 2018, 8:02 AM
lib/Sema/SemaChecking.cpp
8959

const auto *

test/Sema/compare.c
398

Formatting looks off here.

arphaman updated this revision to Diff 132901.Feb 5 2018, 3:58 PM
arphaman marked 4 inline comments as done.

Address review comments and fix the inverted check case.

aaron.ballman accepted this revision.Feb 6 2018, 4:49 AM

LGTM, aside from a minor commenting nit.

lib/Sema/SemaChecking.cpp
8960

to the sign -> from the sign

This revision is now accepted and ready to land.Feb 6 2018, 4:49 AM
arphaman marked an inline comment as done.Feb 7 2018, 12:47 PM
This revision was automatically updated to reflect the committed changes.