ソースを参照

Suppress Wunqualified-std-cast-call on clang 16 or later (#219)

-Wunqualified-std-cast-call warns on missing qualifiers to std:: functions, ie std:: missing from std::move, even if the compiler can resolve move(x) properly.
This warning flag was added in clang 16.
Jeremy L 2 年 前
コミット
0981524bd2
1 ファイル変更7 行追加0 行削除
  1. 7 0
      Jolt/Core/Core.h

+ 7 - 0
Jolt/Core/Core.h

@@ -108,8 +108,14 @@
 #define JPH_SUPPRESS_WARNING_PUSH		JPH_PRAGMA(clang diagnostic push)
 #define JPH_SUPPRESS_WARNING_POP		JPH_PRAGMA(clang diagnostic pop)
 #define JPH_CLANG_SUPPRESS_WARNING(w)	JPH_PRAGMA(clang diagnostic ignored w)
+	#if __clang_major__ >= 16
+		#define JPH_CLANG16_SUPPRESS_WARNING(w)	JPH_PRAGMA(clang diagnostic ignored w)
+	#else
+		#define JPH_CLANG16_SUPPRESS_WARNING(w)
+	#endif
 #else
 #define JPH_CLANG_SUPPRESS_WARNING(w)
+#define JPH_CLANG16_SUPPRESS_WARNING(w)
 #endif
 #ifdef JPH_COMPILER_GCC
 #define JPH_PRAGMA(x)					_Pragma(#x)
@@ -149,6 +155,7 @@
 	JPH_CLANG_SUPPRESS_WARNING("-Wgnu-zero-variadic-macro-arguments")							\
 	JPH_CLANG_SUPPRESS_WARNING("-Wdocumentation-unknown-command")								\
 	JPH_CLANG_SUPPRESS_WARNING("-Wctad-maybe-unsupported")										\
+	JPH_CLANG16_SUPPRESS_WARNING("-Wunqualified-std-cast-call")									\
 	JPH_IF_NOT_ANDROID(JPH_CLANG_SUPPRESS_WARNING("-Wimplicit-int-float-conversion"))			\
 																								\
 	JPH_GCC_SUPPRESS_WARNING("-Wcomment")														\