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;


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;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to