Suppress a warning in gmock

This commit is contained in:
Victor Zverovich 2017-08-21 06:41:03 -07:00
parent 70ef82a8e3
commit 466386d5cd

View File

@ -825,8 +825,9 @@ template <typename T> struct DecayArray<T[]> {
// crashes). // crashes).
template <typename T> template <typename T>
inline T Invalid() { inline T Invalid() {
void *p = NULL;
return const_cast<typename remove_reference<T>::type&>( return const_cast<typename remove_reference<T>::type&>(
*static_cast<volatile typename remove_reference<T>::type*>(NULL)); *static_cast<volatile typename remove_reference<T>::type*>(p));
} }
template <> template <>
inline void Invalid<void>() {} inline void Invalid<void>() {}