Skip to content

Commit 3cf7625

Browse files
omit annoying clang -Wc++26-extensions warning of trivial-relocate (#1209)
1 parent e688323 commit 3cf7625

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

include/fast_io_dsal/impl/misc/push_macros.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,22 @@ Internal assert macros for fuzzing fast_io.
212212
#pragma push_macro("FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE")
213213
#if defined(__cpp_trivial_relocatability)
214214
#undef FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE
215+
#if defined(__clang__)
216+
#define FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE \
217+
_Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wc++26-extensions\"") trivially_relocatable_if_eligible _Pragma("clang diagnostic pop")
218+
#else // ^^^ defined(__clang__) / vvv !defined(__clang__)
215219
#define FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE trivially_relocatable_if_eligible
220+
#endif // ^^^ !defined(__clang__)
216221
#else
217222
#define FAST_IO_TRIVIALLY_RELOCATABLE_IF_ELIGIBLE
218223
#endif
219224

220225
#pragma push_macro("FAST_IO_HAS_BUILTIN")
221226
#undef FAST_IO_HAS_BUILTIN
222227
#ifdef __has_builtin
223-
# define FAST_IO_HAS_BUILTIN(...) __has_builtin(__VA_ARGS__)
228+
#define FAST_IO_HAS_BUILTIN(...) __has_builtin(__VA_ARGS__)
224229
#else
225-
# define FAST_IO_HAS_BUILTIN(...) 0
230+
#define FAST_IO_HAS_BUILTIN(...) 0
226231
#endif
227232

228233
#pragma push_macro("FAST_IO_CPP_RTTI")

0 commit comments

Comments
 (0)