@@ -506,7 +506,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
506
506
defined (GTEST_OS_SOLARIS) || defined(GTEST_OS_HAIKU) || \
507
507
defined(GTEST_OS_ESP32) || defined(GTEST_OS_ESP8266) || \
508
508
defined(GTEST_OS_XTENSA) || defined(GTEST_OS_QURT) || \
509
- defined(GTEST_OS_NXP_QN9090)))
509
+ defined(GTEST_OS_NXP_QN9090) || defined(GTEST_OS_NRF52) ))
510
510
#define GTEST_HAS_STD_WSTRING 1
511
511
#else
512
512
#define GTEST_HAS_STD_WSTRING 0
@@ -1146,47 +1146,6 @@ inline To ImplicitCast_(To x) {
1146
1146
return x;
1147
1147
}
1148
1148
1149
- // When you upcast (that is, cast a pointer from type Foo to type
1150
- // SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
1151
- // always succeed. When you downcast (that is, cast a pointer from
1152
- // type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
1153
- // how do you know the pointer is really of type SubclassOfFoo? It
1154
- // could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
1155
- // when you downcast, you should use this macro. In debug mode, we
1156
- // use dynamic_cast<> to double-check the downcast is legal (we die
1157
- // if it's not). In normal mode, we do the efficient static_cast<>
1158
- // instead. Thus, it's important to test in debug mode to make sure
1159
- // the cast is legal!
1160
- // This is the only place in the code we should use dynamic_cast<>.
1161
- // In particular, you SHOULDN'T be using dynamic_cast<> in order to
1162
- // do RTTI (eg code like this:
1163
- // if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
1164
- // if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
1165
- // You should design the code some other way not to need this.
1166
- //
1167
- // This relatively ugly name is intentional. It prevents clashes with
1168
- // similar functions users may have (e.g., down_cast). The internal
1169
- // namespace alone is not enough because the function can be found by ADL.
1170
- template <typename To, typename From> // use like this: DownCast_<T*>(foo);
1171
- inline To DownCast_ (From* f) { // so we only accept pointers
1172
- // Ensures that To is a sub-type of From *. This test is here only
1173
- // for compile-time type checking, and has no overhead in an
1174
- // optimized build at run-time, as it will be optimized away
1175
- // completely.
1176
- GTEST_INTENTIONAL_CONST_COND_PUSH_ ()
1177
- if (false ) {
1178
- GTEST_INTENTIONAL_CONST_COND_POP_ ()
1179
- const To to = nullptr ;
1180
- ::testing::internal::ImplicitCast_<From*>(to);
1181
- }
1182
-
1183
- #if GTEST_HAS_RTTI
1184
- // RTTI: debug mode only!
1185
- GTEST_CHECK_ (f == nullptr || dynamic_cast <To>(f) != nullptr );
1186
- #endif
1187
- return static_cast <To>(f);
1188
- }
1189
-
1190
1149
// Downcasts the pointer of type Base to Derived.
1191
1150
// Derived must be a subclass of Base. The parameter MUST
1192
1151
// point to a class of type Derived, not any subclass of it.
0 commit comments