Avoid requiring a suppression (unevaluated-expression)
authorYedidya Feldblum <yfeldblum@fb.com>
Tue, 1 Dec 2015 20:04:24 +0000 (12:04 -0800)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Tue, 1 Dec 2015 20:20:23 +0000 (12:20 -0800)
Summary: [Folly] Avoid requiring a suppression (`unevaluated-expression`).

I am not a fan of suppressing warnings. This warning comes from the internals of gtest, but anyway.

Replace with something that does not trigger the warning.

Reviewed By: Gownta

Differential Revision: D2706279

fb-gh-sync-id: 2ecac1d230308a8fd21a69565193c52585526448

folly/test/ExceptionWrapperTest.cpp

index 74e2d0d314e8cde2c3973cafe316c3a80180a617..71a91599e4c5e0ba5f6eec1f62beed448222e5e1 100644 (file)
@@ -177,14 +177,7 @@ TEST(ExceptionWrapper, with_exception_test) {
   EXPECT_EQ(ew2.class_name(), "IntException");
   ew2.with_exception([&](AbstractIntException& ie) {
       EXPECT_EQ(ie.getInt(), expected);
-#if __CLANG_PREREQ(3, 6)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wunevaluated-expression"
-#endif
-      EXPECT_EQ(typeid(ie), typeid(IntException));
-#if __CLANG_PREREQ(3, 6)
-# pragma clang diagnostic pop
-#endif
+      EXPECT_TRUE(dynamic_cast<IntException*>(&ie));
     });
 
   // Test with const this.  If this compiles and does not crash due to