From: Chandler Carruth Date: Wed, 4 Jan 2017 23:57:25 +0000 (+0000) Subject: [gtest] The way EXPECT_TEST now works after upgrading gtest triggers an X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=952bd4324cbd501f3231594e5024ca19ef3496ad;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291036 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp b/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp index 67a4a3b2fc..5957c7fa41 100644 --- a/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp +++ b/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp @@ -222,9 +222,12 @@ TEST(HasDeclaration, HasDeclarationOfEnumType) { } TEST(HasDeclaration, HasGetDeclTraitTest) { - EXPECT_TRUE(internal::has_getDecl::value); - EXPECT_TRUE(internal::has_getDecl::value); - EXPECT_FALSE(internal::has_getDecl::value); + static_assert(internal::has_getDecl::value, + "Expected TypedefType to have a getDecl."); + static_assert(internal::has_getDecl::value, + "Expected RecordType to have a getDecl."); + static_assert(!internal::has_getDecl::value, + "Expected TemplateSpecializationType to *not* have a getDecl."); } TEST(HasDeclaration, HasDeclarationOfTypeWithDecl) {