1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-29 06:20:32 +08:00

fix const correctness issue on gcc

This commit is contained in:
Eric Fiselier 2015-03-27 05:09:11 -04:00
parent 166334a284
commit bc9b6cf890

View File

@ -185,7 +185,7 @@ void UseCharPointer(char const volatile*);
#if defined(__GNUC__)
template <class Tp>
inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
asm volatile("" : "+r" (value));
asm volatile("" : "+r" (const_cast<Tp&>(value)));
}
#else
template <class Tp>