summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2017-01-04 23:57:25 +0000
committerChandler Carruth <chandlerc@gmail.com>2017-01-04 23:57:25 +0000
commit5b717f34399a1cd2819c89a9501bcd674b58c3c8 (patch)
tree97de698f1f82b4b978075efafbf2639775fc47ca
parente2f2d1edef9fda1c7533850cdcbeccf8083a677a (diff)
downloadbcm5719-llvm-5b717f34399a1cd2819c89a9501bcd674b58c3c8.tar.gz
bcm5719-llvm-5b717f34399a1cd2819c89a9501bcd674b58c3c8.zip
[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
-rw-r--r--clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
index 67a4a3b2fc0..5957c7fa41d 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
+++ b/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
@@ -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) {
OpenPOWER on IntegriCloud