This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Handle c-style casts from/to enums.
ClosedPublic

Authored by alexfh on Oct 1 2014, 5:29 AM.

Diff Detail

Event Timeline

alexfh updated this revision to Diff 14275.Oct 1 2014, 5:29 AM
alexfh retitled this revision from to [clang-tidy] Handle c-style casts from/to enums..
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: klimek.
alexfh added a subscriber: Unknown Object (MLST).
klimek accepted this revision.Oct 1 2014, 5:39 AM
klimek edited edge metadata.

lg

clang-tidy/google/AvoidCStyleCastsCheck.cpp
85–89

Why does getTypeAsWritten not work any more? Perhaps add a comment explaining that...

This revision is now accepted and ready to land.Oct 1 2014, 5:39 AM
alexfh added inline comments.Oct 1 2014, 5:57 AM
clang-tidy/google/AvoidCStyleCastsCheck.cpp
85–89

getTypeAsWritten().getAsString() normalizes spelling of types in certain ways, e.g. "char*" -> "char *", "SomeEnum" -> "enum SomeEnum", which we don't want to do.

alexfh closed this revision.Oct 1 2014, 5:57 AM
klimek added inline comments.Oct 1 2014, 5:58 AM
clang-tidy/google/AvoidCStyleCastsCheck.cpp
85–89

The char* -> char * we don't really care about. The enum seems important, thus putting that into a comment would be nice.