#974841 ms-gsl: new clang test fails on s390x

Package:
src:ms-gsl
Source:
ms-gsl
Submitter:
Gianfranco Costamagna
Date:
2020-12-29 17:57:04 UTC
Severity:
important
#974841#5
Date:
2020-11-15 13:11:06 UTC
From:
To:
Hello, looks like the new clang tests are failing on s390x, I don't know why...

I can say that removing
"flags" (set flags= on line 13 of entry file) to make it behave in a similar way with gcc works to shut down the errors

https://autopkgtest.ubuntu.com/packages/m/ms-gsl/hirsute/s390x


unfortunately, after doing that, there is still a failure on s390x with clang-11

cd /home/locutusofborg/ms-gsl-3.1.0/pippo/ms-gsl/tests && /usr/bin/clang++-11  -I/home/locutusofborg/ms-gsl-3.1.0/include -isystem /home/locutusofborg/ms-gsl-3.1.0/tests/googletest/googletest/include -O3 -DNDEBUG -fno-strict-aliasing -Wall -Wcast-align -Wconversion -Wctor-dtor-privacy -Werror -Wextra -Wpedantic -Wshadow -Wsign-conversion -Wno-deprecated-declarations -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-missing-braces -Wno-covered-switch-default -Wno-global-constructors -Wno-missing-prototypes -Wno-padded -Wno-unknown-attributes -Wno-used-but-marked-unused -Wno-weak-vtables -std=c++20 -o CMakeFiles/assertion_tests.dir/assertion_tests.cpp.o -c /home/locutusofborg/ms-gsl-3.1.0/tests/assertion_tests.cpp
In file included from /home/locutusofborg/ms-gsl-3.1.0/tests/notnull_tests.cpp:19:
/home/locutusofborg/ms-gsl-3.1.0/include/gsl/pointers:146:86: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
auto operator<(const not_null<T>& lhs, const not_null<U>& rhs) -> decltype(lhs.get() < rhs.get())
                                                                                     ^
                                                                                     nullptr
/usr/bin/../lib/gcc/s390x-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr.h:448:5: note: while rewriting comparison as call to 'operator<=>' declared here
    operator<=>(const shared_ptr<_Tp>& __a,
    ^
/home/locutusofborg/ms-gsl-3.1.0/tests/notnull_tests.cpp:363:34: note: while substituting deduced template arguments into function template 'operator<' [with T = std::shared_ptr<int>, U = std::shared_ptr<int>]
    EXPECT_TRUE((NotNullSp1(sp1) < NotNullSp1(sp1)) == false);
                                 ^
In file included from /home/locutusofborg/ms-gsl-3.1.0/tests/notnull_tests.cpp:19:
/home/locutusofborg/ms-gsl-3.1.0/include/gsl/pointers:146:86: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
auto operator<(const not_null<T>& lhs, const not_null<U>& rhs) -> decltype(lhs.get() < rhs.get())
                                                                                     ^
                                                                                     nullptr
/usr/bin/../lib/gcc/s390x-linux-gnu/10/../../../../include/c++/10/bits/shared_ptr.h:448:5: note: while rewriting comparison as call to 'operator<=>' declared here
    operator<=>(const shared_ptr<_Tp>& __a,
    ^
/home/locutusofborg/ms-gsl-3.1.0/tests/notnull_tests.cpp:364:34: note: while substituting deduced template arguments into function template 'operator<' [with T = std::shared_ptr<int>, U = std::shared_ptr<const int>]
    EXPECT_TRUE((NotNullSp1(sp1) < NotNullSp2(sp2)) == (sp1 < sp2));
                                 ^
/home/locutusofborg/ms-gsl-3.1.0/tests/notnull_tests.cpp:364:61: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
    EXPECT_TRUE((NotNullSp1(sp1) < NotNullSp2(sp2)) == (sp1 < sp2));
                                                            ^
                                                            nullptr

(full log attached)

Can you please have a look? this error might be a real error spotted by clang-11 (and maybe when optimization level is set to -O3? I don't honestly know)

thanks

Gianfranco