forked from OSchip/llvm-project
TestClangASTContext: Rewrite an if-else chain into a switch
This avoids the "ambiguous else" warning, which comes from within the EXPECT_TRUE macro. llvm-svn: 351331
This commit is contained in:
parent
dd487d6521
commit
2a32a69c53
|
@ -190,12 +190,20 @@ void VerifyEncodingAndBitSize(clang::ASTContext *context,
|
|||
return;
|
||||
|
||||
EXPECT_TRUE(type_ptr->isBuiltinType());
|
||||
if (encoding == eEncodingSint)
|
||||
switch (encoding) {
|
||||
case eEncodingSint:
|
||||
EXPECT_TRUE(type_ptr->isSignedIntegerType());
|
||||
else if (encoding == eEncodingUint)
|
||||
break;
|
||||
case eEncodingUint:
|
||||
EXPECT_TRUE(type_ptr->isUnsignedIntegerType());
|
||||
else if (encoding == eEncodingIEEE754)
|
||||
break;
|
||||
case eEncodingIEEE754:
|
||||
EXPECT_TRUE(type_ptr->isFloatingType());
|
||||
break;
|
||||
default:
|
||||
FAIL() << "Unexpected encoding";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(TestClangASTContext, TestBuiltinTypeForEncodingAndBitSize) {
|
||||
|
|
Loading…
Reference in New Issue