fix clang-tidy error in clion on windows when using m_fields

This commit is contained in:
ConfiG 2024-01-13 22:12:20 +03:00
parent f0127bdb88
commit 05064eb4d5
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B
2 changed files with 13 additions and 2 deletions

View file

@ -124,7 +124,18 @@ namespace geode::modifier {
}
Parent* operator->() {
// workaround for "static assertion is not an integral constant expression" in CLion
// while the solution in https://github.com/microsoft/STL/issues/3311 works, you can't provide
// cli args to clang-tidy in clion, so we use this workaround instead
// https://youtrack.jetbrains.com/issue/CPP-27446/spurious-offsetof-in-staticassert-error-from-clangd#focus=Comments-27-8172811.0-0
// update: that workaround didn't work,
// undefining and re-defining offsetof caused another error further down
// so we're doing this now
#ifdef __CLION_IDE__
return reinterpret_cast<Parent*>(69420);
#else
return this->operator Parent*();
#endif
}
};

View file

@ -130,7 +130,7 @@ namespace geode {
// with an error of "incomplete type is not allowed", despite not being an issue in actual compilation.
// So as a workaround use the compiler defined "__INTELLISENSE__" macro, which gets set to 1 on the intellisense pass.
// See https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170#microsoft-specific-predefined-macros
#if __INTELLISENSE__ != 1
#if __INTELLISENSE__ != 1 && !defined(__CLION_IDE__)
template <class Derived, class Base>
class Modify : public Base {
@ -189,7 +189,7 @@ namespace geode {
* I am bad at this stuff
*/
#if __INTELLISENSE__ != 1
#if __INTELLISENSE__ != 1 && !defined(__CLION_IDE__)
#define GEODE_MODIFY_DECLARE_ANONYMOUS(base, derived) \
derived##Dummy; \