ExceptionWrapperTest.cpp vs clang's new warning about side effects in typeid argument list
ExceptionWrapperTest.cpp vs clang's new warning about side effects in typeid argument list

Summary:
Disable the -Wunevaluated-expression warning for this test:

EXPECT_EQ(typeid(ie), typeid(IntException));

Otherwise, clang warns about the unevaluated expression because
the expansion of EXPECT_EQ applies sizeof to an expression
with side effects:

folly/test/ExceptionWrapperTest.cpp:179:122: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]
switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar = (::testing::internal:: EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(typeid(ie))) == 1)>::Compare("typeid(ie)", "typeid(IntException)", typeid(ie), typeid(IntException)))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "folly/test/ExceptionWrapperTest.cpp", 179, gtest_ar.failure_message()) = ::testing::Message();

Test Plan:
Ensure this compiles with clang-3.4, 3.5 and clang:dev.
I.e., ensure that this prints PASS at the end.

for i in '' 3.5 dev; do
test -n "$i" && i=--with-project-version=clang:$i
fbconfig -r --clang $i folly/test:exception_wrapper_test && fbmake dbgo
done && echo PASS

Reviewed By: mpawlowski@fb.com

Subscribers: mathieubaudet, folly-diffs@, yfeldblum

FB internal diff: D1850778

Tasks: 6244745

Signature: t1:1850778:1424111029:136478e9a3cc3a219047547d501de4c579a1a181

cppfool/folly,raphaelamorim/folly,arg0/folly,Orvid/folly,sonnyhu/folly,gavioto/folly,SammyK/folly,stonegithubs/folly,fw1121/folly,bobegir/folly,yangjin-unique/folly,nickhen/folly,xzmagic/folly,hongliangzhao/folly,arg0/folly,kernelim/folly,juniway/folly,romange/folly,sakishum/folly,clearlylin/folly,bobegir/folly,mqeizi/folly,bikong2/folly,chjp2046/folly,SeanRBurton/folly,lifei/folly,loversInJapan/folly,cole14/folly,PoisonBOx/folly,renyinew/folly,bowlofstew/folly,chjp2046/folly,shaobz/folly,colemancda/folly,floxard/folly,doctaweeks/folly,PoisonBOx/folly,raphaelamorim/folly,xzmagic/folly,doctaweeks/folly,xzmagic/folly,ykarlsbrun/folly,alexst07/folly,sakishum/folly,wildinto/folly,loverszhaokai/folly,leolujuyi/folly,charsyam/folly,wildinto/folly,project-zerus/folly,nickhen/folly,cole14/folly,clearlylin/folly,SeanRBurton/folly,rklabs/folly,xzmagic/folly,tomhughes/folly,constantine001/folly,chjp2046/folly,Eagle-X/folly,theiver9827/folly,kernelim/folly,tomhughes/folly,gaoyingie/folly,tempbottle/folly,loverszhaokai/folly,lifei/folly,hongliangzhao/folly,reddit/folly,alexst07/folly,zhiweicai/folly,sonnyhu/folly,loversInJapan/folly,bsampath/folly,sonnyhu/folly,clearlylin/folly,rklabs/folly,PPC64/folly,chjp2046/folly,PoisonBOx/folly,fw1121/folly,raphaelamorim/folly,doctaweeks/folly,KSreeHarsha/folly,Hincoin/folly,nickhen/folly,tempbottle/folly,Hincoin/folly,tempbottle/folly,clearlylin/folly,PoisonBOx/folly,lifei/folly,bikong2/folly,KSreeHarsha/folly,Orvid/folly,loversInJapan/folly,chjp2046/folly,bowlofstew/folly,tempbottle/folly,bikong2/folly,sonnyhu/folly,bowlofstew/folly,constantine001/folly,nickhen/folly,Orvid/folly,tomhughes/folly,upsoft/folly,tomhughes/folly,clearlinux/folly,hongliangzhao/folly,lifei/folly,upsoft/folly,kernelim/folly,reddit/folly,tomhughes/folly,bsampath/folly,project-zerus/folly,sonnyhu/folly,brunomorishita/folly,floxard/folly,guker/folly,clearlinux/folly,raphaelamorim/folly,project-zerus/folly,guker/folly,romange/folly,clearlinux/folly,facebook/folly,lifei/folly,SammyK/folly,reddit/folly,kernelim/folly,cole14/folly,theiver9827/folly,bobegir/folly,upsoft/folly,gavioto/folly,sakishum/folly,juniway/folly,renyinew/folly,yangjin-unique/folly,bobegir/folly,yangjin-unique/folly,Hincoin/folly,hongliangzhao/folly,arg0/folly,facebook/folly,bikong2/folly,SammyK/folly,ykarlsbrun/folly,fw1121/folly,renyinew/folly,colemancda/folly,mqeizi/folly,alexst07/folly,ykarlsbrun/folly,SeanRBurton/folly,renyinew/folly,mqeizi/folly,Eagle-X/folly,cppfool/folly,PPC64/folly,bobegir/folly,shaobz/folly,floxard/folly,project-zerus/folly,fw1121/folly,Eagle-X/folly,KSreeHarsha/folly,cppfool/folly,KSreeHarsha/folly,leolujuyi/folly,PPC64/folly,gavioto/folly,floxard/folly,leolujuyi/folly,charsyam/folly,wildinto/folly,sakishum/folly,PPC64/folly,loverszhaokai/folly,PoisonBOx/folly,hongliangzhao/folly,Hincoin/folly,facebook/folly,SeanRBurton/folly,xzmagic/folly,romange/folly,cppfool/folly,zhiweicai/folly,CJstar/folly,renyinew/folly,brunomorishita/folly,bsampath/folly,bsampath/folly,rklabs/folly,brunomorishita/folly,guker/folly,Hincoin/folly,leolujuyi/folly,upsoft/folly,bikong2/folly,yangjin-unique/folly,charsyam/folly,sakishum/folly,zhiweicai/folly,clearlylin/folly,SeanRBurton/folly,constantine001/folly,reddit/folly,wildinto/folly,juniway/folly,CJstar/folly,cole14/folly,floxard/folly,romange/folly,guker/folly,cppfool/folly,brunomorishita/folly,mqeizi/folly,PPC64/folly,Eagle-X/folly,gaoyingie/folly,mqeizi/folly,KSreeHarsha/folly,gaoyingie/folly,raphaelamorim/folly,shaobz/folly,clearlinux/folly,CJstar/folly,CJstar/folly,SammyK/folly,alexst07/folly,kernelim/folly,cole14/folly,alexst07/folly,guker/folly,Orvid/folly,gavioto/folly,stonegithubs/folly,SammyK/folly,doctaweeks/folly,bowlofstew/folly,stonegithubs/folly,Eagle-X/folly,loverszhaokai/folly,clearlinux/folly,zhiweicai/folly,juniway/folly,stonegithubs/folly,arg0/folly,romange/folly,constantine001/folly,colemancda/folly,theiver9827/folly,project-zerus/folly,constantine001/folly,loverszhaokai/folly,theiver9827/folly,colemancda/folly,facebook/folly,brunomorishita/folly,zhiweicai/folly,gaoyingie/folly,wildinto/folly,upsoft/folly,bsampath/folly,loversInJapan/folly,rklabs/folly,theiver9827/folly,charsyam/folly,gavioto/folly,loversInJapan/folly,doctaweeks/folly,stonegithubs/folly,reddit/folly,ykarlsbrun/folly,colemancda/folly,facebook/folly,Orvid/folly,CJstar/folly,yangjin-unique/folly,rklabs/folly,leolujuyi/folly,fw1121/folly,gaoyingie/folly,nickhen/folly,tempbottle/folly,juniway/folly,ykarlsbrun/folly,shaobz/folly,arg0/folly,bowlofstew/folly,shaobz/folly