[PATCH] D71486: [clang-tools-extra] Fix switch coverage warning
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 13 12:42:07 PST 2019
sammccall added a comment.
It should be possible to test this by adapting a test case from the original ed8dadb <https://reviews.llvm.org/rGed8dadb37c7e1a7f4889d868ac9b19bfe7762237>, but I'm not certain...
================
Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:525
+ case clang::DiagnosticsEngine::ak_addrspace:
+ Builder << Qualifiers::getAddrSpaceAsString(
+ *reinterpret_cast<LangAS *>(Info.getRawArg(Index)));
----------------
Not very familiar with this code, but it looks like this is feeding the arg back into a builder, and ed8dadb added support for sending LangAS itself to the builder.
So I don't think we should stringify it, but just send the LangAS
================
Comment at: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:526
+ Builder << Qualifiers::getAddrSpaceAsString(
+ *reinterpret_cast<LangAS *>(Info.getRawArg(Index)));
+ break;
----------------
I think the stored thing is a LangAS (an enum), rather than a pointer to one.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71486/new/
https://reviews.llvm.org/D71486
More information about the cfe-commits
mailing list