Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5c7eec2 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

C++17 compatibility: add missing `constexpr`.

Fixes this error when we move the global default to C++17:

  hardware/google/av/codec2/tests/C2_test.cpp:142:19: error: static_assert expression is not an integral constant expression
    static_assert(c2_cntr32_t(1) ==
c2_cntr32_t(c2_cntr64_t(0x100000001ul)), "1 == 1");
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug: http://b/111067277
Test: builds
Change-Id: I66b8573d5dbdb02f953ec54b77eff274333c6f83
parent c55606b2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -289,7 +289,7 @@ public:
     * Convert to a smaller counter type. This is always safe.
     */
    template<typename U, typename E=typename std::enable_if<(sizeof(U) < sizeof(T))>::type>
    inline operator c2_cntr_t<U>() {
    inline constexpr operator c2_cntr_t<U>() {
        return c2_cntr_t<U>(mValue);
    }