r291036 - [gtest] The way EXPECT_TEST now works after upgrading gtest triggers an
Chandler Carruth via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 4 15:57:25 PST 2017
Author: chandlerc
Date: Wed Jan 4 17:57:25 2017
New Revision: 291036
URL: http://llvm.org/viewvc/llvm-project?rev=291036&view=rev
Log:
[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.
Modified:
cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
Modified: cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp?rev=291036&r1=291035&r2=291036&view=diff
==============================================================================
--- cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp (original)
+++ cfe/trunk/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp Wed Jan 4 17:57:25 2017
@@ -222,9 +222,12 @@ TEST(HasDeclaration, HasDeclarationOfEnu
}
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) {
More information about the cfe-commits
mailing list