diff --git a/kdevplatform/language/duchain/topducontextdynamicdata.cpp b/kdevplatform/language/duchain/topducontextdynamicdata.cpp --- a/kdevplatform/language/duchain/topducontextdynamicdata.cpp +++ b/kdevplatform/language/duchain/topducontextdynamicdata.cpp @@ -87,7 +87,12 @@ disableDUChainReferenceCounting(data.back().array.data()); }else{ //Just copy the data into another place, expensive copy constructors are not needed +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" memcpy(&target, item.d_func(), size); +#pragma GCC diagnostic pop +#endif if (!isSharedDataItem) { item.setData(&target, false); } @@ -759,7 +764,12 @@ totalDataOffset += size; auto target = reinterpret_cast(m_data.back().array.data() + pos); +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" memcpy(target, data, size); +#pragma GCC diagnostic pop +#endif verifyDataInfo(ret, m_data); return ret; diff --git a/kdevplatform/serialization/itemrepository.h b/kdevplatform/serialization/itemrepository.h --- a/kdevplatform/serialization/itemrepository.h +++ b/kdevplatform/serialization/itemrepository.h @@ -569,7 +569,12 @@ disableDUChainReferenceCounting(m_data); #ifndef QT_NO_DEBUG +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" memset(item, 0, size); //For debugging, so we notice the data is wrong +#pragma GCC diagnostic pop +#endif #endif if(m_monsterBucketExtent) { diff --git a/kdevplatform/util/embeddedfreetree.h b/kdevplatform/util/embeddedfreetree.h --- a/kdevplatform/util/embeddedfreetree.h +++ b/kdevplatform/util/embeddedfreetree.h @@ -684,6 +684,9 @@ //bound cannot be pos, because pos is invalid Q_ASSERT(bound != pos); +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 800) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wclass-memaccess" //Shuffle around the item at the free pos, so reference counting in constructors/destructors is not screwed up char backup[sizeof(Data)]; memcpy(backup, m_items+pos, sizeof(Data)); @@ -707,6 +710,8 @@ target = bound-1; } memcpy(m_items+target, backup, sizeof(Data)); +#pragma GCC diagnostic pop +#endif ItemHandler::copyTo(data, m_items[target]); return true; diff --git a/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt b/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt --- a/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt +++ b/plugins/qmljs/3rdparty/qtcreator-libs/CMakeLists.txt @@ -51,6 +51,11 @@ target_link_libraries(kdevqtc-qmlsupport LINK_PRIVATE "-framework Foundation" ) endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0") + target_compile_options(kdevqtc-qmlsupport PRIVATE "-Wno-class-memaccess") + endif() +endif() if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") target_compile_options(kdevqtc-qmlsupport PRIVATE "-Wno-documentation") endif()