Page MenuHomePhabricator

Fixed build warning for constexpr in amount.h for C++14
ClosedPublic

Authored by jasonbcox on Jan 11 2018, 19:29.

Details

Summary

Ran into this warning while building on OSX:

../../src/amount.h:75:22: 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 Amount operator-() { return Amount(-amount); }
                     ^
                                 const

It looks like the rest of the constexpr in this file are either friends or already have const applied.

Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable