diff options
author | Martin <martin.brain@cs.ox.ac.uk> | 2020-05-27 19:26:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 11:26:51 -0700 |
commit | 449cf281987eb8a2d43a572817db5c870a010c08 (patch) | |
tree | 10a8dc1bdf6a0c9e9a892e21871f52518707c8c8 /src/util | |
parent | d8b6767e4e5285fef3cf4450b9cba04431e40727 (diff) |
Tweak the use of static_assert to support older compilers. (#4536)
C++11 introduces static_assert(bool, string).
C++17 introduces static_assert(bool)
By adding a message we can support older compilers such as those
used by our nightly build system...
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/floatingpoint.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/floatingpoint.cpp b/src/util/floatingpoint.cpp index 3bcf2b0de..f5545f73c 100644 --- a/src/util/floatingpoint.cpp +++ b/src/util/floatingpoint.cpp @@ -925,7 +925,8 @@ static FloatingPointLiteral constructorHelperBitVector( // We only have multiplyByPow(uint32_t) so we can't convert all numbers. // As we convert Integer -> unsigned int -> uint32_t we need that // unsigned int is not smaller than uint32_t - static_assert(sizeof(unsigned int) >= sizeof(uint32_t)); + static_assert(sizeof(unsigned int) >= sizeof(uint32_t), + "Conversion float -> real could loose data"); #ifdef CVC4_ASSERTIONS // Note that multipling by 2^n requires n bits of space (worst case) // so, in effect, these tests limit us to cases where the resultant |