[PATCH] D75752: [Sema] Move pointer to int cast warnings under -Wmicrosoft-cast
Arthur Eubanks via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 6 08:46:15 PST 2020
aeubanks created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
aeubanks edited the summary of this revision.
aeubanks added reviewers: thakis, rnk.
aeubanks retitled this revision from "Move warnings added in https://reviews.llvm.org/D75708 under -Wmicrosoft-cast" to "[Sema] Move pointer to int cast warnings under -Wmicrosoft-cast".
aeubanks edited the summary of this revision.
Microsoft extensions should be under a -Wmicrosoft-foo group.
Added in https://reviews.llvm.org/D75708.
There shouldn't be a reason to separate out void pointers since this is C++.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D75752
Files:
clang/lib/Sema/SemaCast.cpp
Index: clang/lib/Sema/SemaCast.cpp
===================================================================
--- clang/lib/Sema/SemaCast.cpp
+++ clang/lib/Sema/SemaCast.cpp
@@ -2209,10 +2209,8 @@
bool MicrosoftException =
Self.getLangOpts().MicrosoftExt && !DestType->isBooleanType();
if (MicrosoftException) {
- unsigned Diag = SrcType->isVoidPointerType()
- ? diag::warn_void_pointer_to_int_cast
- : diag::warn_pointer_to_int_cast;
- Self.Diag(OpRange.getBegin(), Diag) << SrcType << DestType << OpRange;
+ Self.Diag(OpRange.getBegin(), diag::ext_ms_pointer_to_int_cast)
+ << SrcType << DestType << OpRange;
} else {
msg = diag::err_bad_reinterpret_cast_small_int;
return TC_Failed;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75752.248739.patch
Type: text/x-patch
Size: 815 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200306/2c00a7bb/attachment-0001.bin>
More information about the cfe-commits
mailing list