martinmoene / expected-dark

Expected objects for C++11 and later (and later perhaps C++98 )
MIT License
52 stars 4 forks source link

Compiles with warnings on clang #19

Closed rnburn closed 6 years ago

rnburn commented 6 years ago

With the default compiler options, expected-lite generates these warnings when compiling with std=c++11

prog.cc:115:29: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
    constexpr value_type && value() &&
                            ^
                                    const
prog.cc:670:29: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
    constexpr value_type && operator *() &&
                            ^
                                         const
prog.cc:699:29: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
    constexpr value_type && value() &&
                            ^
                                    const
prog.cc:716:29: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
    constexpr error_type && error() &&
                            ^
                                    const
prog.cc:938:29: warning: 'constexpr' non-static member function will not be implicitly 'const' in C++14; add 'const' to avoid a change in behavior [-Wconstexpr-not-const]
    constexpr error_type && error() &&
                            ^
                                    const
prog.cc:361:33: warning: unused variable 'unexpect' [-Wunused-const-variable]
constexpr in_place_unexpected_t unexpect{};
                                ^
prog.cc:362:33: warning: unused variable 'in_place_unexpected' [-Wunused-const-variable]
constexpr in_place_unexpected_t in_place_unexpected{};
                                ^
7 warnings generated.

See https://wandbox.org/permlink/EWLHIVPaknnsIS7T

martinmoene commented 6 years ago

Thanks for noting Ryan,

A good trigger to also update the CI here to the setup I use with e.g. string_view lite and gsl lite.