1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
From 9b5e4e10286f45664305c53360ce56d3fd96bf74 Mon Sep 17 00:00:00 2001
From: David LeBlanc <dcl@dleblanc.net>
Date: Sat, 2 Sep 2023 15:56:08 -0700
Subject: [PATCH] Make fix for gcc13 breaking change
Forwarded: not-needed
Bug: https://github.com/dcleblanc/SafeInt/issues/55
--- a/Test/GccTest/CMakeLists.txt
+++ b/Test/GccTest/CMakeLists.txt
@@ -132,14 +132,20 @@
target_compile_options(CompileTest_gcc14_NoEH PUBLIC -Wall -std=c++14 -fno-exceptions)
- add_executable(CompileTest_gcc98
- ../CompileTest.cpp
- ../ConstExpr.cpp
- ../CleanCompile.cpp
- ../../SafeInt.hpp
- )
+ if(${CMAKE_CXX_COMPILER_VERSION} GREATER_EQUAL "13")
+ message(STATUS "not running c++98 tests")
+ else()
+ add_executable(CompileTest_gcc98
+ ../CompileTest.cpp
+ ../ConstExpr.cpp
+ ../CleanCompile.cpp
+ ../../SafeInt.hpp
+ )
+
+ target_compile_options(CompileTest_gcc98 PUBLIC -D SAFEINT_USE_CPLUSCPLUS_98 -Wall -std=c++98 -fno-exceptions)
+ endif()
+
- target_compile_options(CompileTest_gcc98 PUBLIC -D SAFEINT_USE_CPLUSCPLUS_98 -Wall -std=c++98 -fno-exceptions)
add_executable(safe_math_test_gcc
../c_safe_math/safe_math_test.c
--- a/Test/CompileTest.cpp
+++ b/Test/CompileTest.cpp
@@ -257,32 +257,6 @@
}
-void MoveRegression()
-{
- #if CPLUSPLUS_STD == CPLUSPLUS_17
- #include <variant>
- #include <string>
-
- template<typename... T>
- class Union {
- public:
- Union() = default;
- Union& operator=(Union&&) noexcept = default;
-
- template<typename F>
- Union& operator=(F&& t) {
- value = std::forward<F>(t);
- return *this;
- }
-
- std::variant<T...> value;
- };
-
- Union<std::string, SafeInt<int64_t>> x;
- Union<std::string, SafeInt<int64_t>> y;
- x = std::move(y);
- #endif
-}
void CompileMe()
{
CompileType<char>();
@@ -303,7 +277,6 @@
CompileSigned<signed int>();
CompileSigned<signed long>();
CompileSigned<signed long long>();
- MoveRegression();
}
/*
|