mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 04:14:27 +02:00
fix: clang-17 with modules build on ignores disabling conversion warnings
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
// SOFTWARE.
|
// SOFTWARE.
|
||||||
|
|
||||||
|
#include <mp-units/bits/external/hacks.h>
|
||||||
|
//
|
||||||
#include "test_tools.h"
|
#include "test_tools.h"
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -402,6 +404,8 @@ static_assert((std::uint8_t(255) * m %= 257 * m).numerical_value_in(m) != [] {
|
|||||||
// TODO ICE
|
// TODO ICE
|
||||||
// (https://developercommunity2.visualstudio.com/t/ICE-on-a-constexpr-operator-in-mp-unit/1302907)
|
// (https://developercommunity2.visualstudio.com/t/ICE-on-a-constexpr-operator-in-mp-unit/1302907)
|
||||||
#ifndef MP_UNITS_COMP_MSVC
|
#ifndef MP_UNITS_COMP_MSVC
|
||||||
|
// clang-17 with modules build on ignores disabling conversion warnings
|
||||||
|
#if !(defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG < 18 && defined MP_UNITS_MODULES)
|
||||||
// next two lines trigger conversions warnings
|
// next two lines trigger conversions warnings
|
||||||
// (warning disabled in CMake for this file)
|
// (warning disabled in CMake for this file)
|
||||||
static_assert((22 * m *= 33.33).numerical_value_in(m) == 733);
|
static_assert((22 * m *= 33.33).numerical_value_in(m) == 733);
|
||||||
@@ -409,6 +413,7 @@ static_assert((22 * m /= 3.33).numerical_value_in(m) == 6);
|
|||||||
static_assert((22 * m *= 33.33 * one).numerical_value_in(m) == 733);
|
static_assert((22 * m *= 33.33 * one).numerical_value_in(m) == 733);
|
||||||
static_assert((22 * m /= 3.33 * one).numerical_value_in(m) == 6);
|
static_assert((22 * m /= 3.33 * one).numerical_value_in(m) == 6);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
template<template<auto, typename> typename Q>
|
template<template<auto, typename> typename Q>
|
||||||
concept invalid_compound_assignments = requires() {
|
concept invalid_compound_assignments = requires() {
|
||||||
|
Reference in New Issue
Block a user