Change static const to static constexpr
static const within a class is somewhat broken in a variety of contexts
in C++. In particular, you should not try to define the value at the
declaration site, like:
class MyClass {
public:
static const int mConst = 5;
};
For some reason, C++ allows this, but then you can only use mConst in
integral constant expressions. If you need a reference, then this whole
thing breaks. However, under certain compilation options, the compiler
may compile away the references and it will compile anyway (which seems
to be the status quo for this particular case).
Anyway, I have been fiddling with the compiler options, and I now get an
undefined reference to TEST_TIMEOUT. Because we don't actually need a
concrete object in memory for this value at all, static constexpr is a
much better option for such a constant.
Reference: https://stackoverflow.com/a/3026054
Flag: EXEMPT bugfix
Change-Id: Idb964a2af3ee50833233a52879952f29854e1629
Merged-In: Idb964a2af3ee50833233a52879952f29854e1629
(cherry-picked from commit: 3354ccd23fc3757d2049a19357ed9346d64ef563)
1 file changed