[clang] [clang-c] Don't deprecate CXRemapping as well as its users (PR #149975)

Simon Pilgrim via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 22 05:26:20 PDT 2025


https://github.com/RKSimon updated https://github.com/llvm/llvm-project/pull/149975

>From cb023012762bfda65d351ff3f4b047e350142357 Mon Sep 17 00:00:00 2001
From: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: Tue, 22 Jul 2025 09:46:56 +0100
Subject: [PATCH 1/3] [clang-c] Don't deprecate CXRemapping and its users

#149079 deprecated CXRemapping and all its methods, however MSVC warns when a deprecated method is using a deprecated variable (and breaks our Werror builds) - best way to avoid this is to only deprecate the methods directly.
---
 clang/include/clang-c/Index.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index b929585205aee..10b70b4f53eac 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -6953,7 +6953,6 @@ clang_getCursorUnaryOperatorKind(CXCursor cursor);
  * @}
  */
 
-CINDEX_DEPRECATED
 typedef void *CXRemapping;
 
 CINDEX_DEPRECATED CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *);

>From 27000a73490c644589890da2559b307cc982e386 Mon Sep 17 00:00:00 2001
From: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: Tue, 22 Jul 2025 13:06:30 +0100
Subject: [PATCH 2/3] Comment out CINDEX_DEPRECATED instead with explanation

---
 clang/include/clang-c/Index.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 10b70b4f53eac..04fc1a7c437fd 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -6953,6 +6953,7 @@ clang_getCursorUnaryOperatorKind(CXCursor cursor);
  * @}
  */
 
+/* CINDEX_DEPRECATED - disable this to appease MSVC deprecation diagnostic warnings */
 typedef void *CXRemapping;
 
 CINDEX_DEPRECATED CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *);

>From fd3eaba4b36a9602aa839bdcefdafa43769e79c2 Mon Sep 17 00:00:00 2001
From: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: Tue, 22 Jul 2025 13:26:05 +0100
Subject: [PATCH 3/3] clang-format

---
 clang/include/clang-c/Index.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index 04fc1a7c437fd..be038d9165fc6 100644
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -6953,7 +6953,7 @@ clang_getCursorUnaryOperatorKind(CXCursor cursor);
  * @}
  */
 
-/* CINDEX_DEPRECATED - disable this to appease MSVC deprecation diagnostic warnings */
+/* CINDEX_DEPRECATED - disabled to silence MSVC deprecation warnings */
 typedef void *CXRemapping;
 
 CINDEX_DEPRECATED CINDEX_LINKAGE CXRemapping clang_getRemappings(const char *);



More information about the cfe-commits mailing list