[gtest] The way EXPECT_TEST now works after upgrading gtest triggers an

ODR use. These traits don't have a definition as they're intended to be
used strictly at compile time. Change the tests to use static_assert to
move the entire thing into compile-time.

llvm-svn: 291036
This commit is contained in:
Chandler Carruth 2017-01-04 23:57:25 +00:00
parent e2f2d1edef
commit 5b717f3439
1 changed files with 6 additions and 3 deletions

View File

@ -222,9 +222,12 @@ TEST(HasDeclaration, HasDeclarationOfEnumType) {
}
TEST(HasDeclaration, HasGetDeclTraitTest) {
EXPECT_TRUE(internal::has_getDecl<TypedefType>::value);
EXPECT_TRUE(internal::has_getDecl<RecordType>::value);
EXPECT_FALSE(internal::has_getDecl<TemplateSpecializationType>::value);
static_assert(internal::has_getDecl<TypedefType>::value,
"Expected TypedefType to have a getDecl.");
static_assert(internal::has_getDecl<RecordType>::value,
"Expected RecordType to have a getDecl.");
static_assert(!internal::has_getDecl<TemplateSpecializationType>::value,
"Expected TemplateSpecializationType to *not* have a getDecl.");
}
TEST(HasDeclaration, HasDeclarationOfTypeWithDecl) {