diff --git a/unittests/ADT/TypeTraitsTest.cpp b/unittests/ADT/TypeTraitsTest.cpp index d38505ce37c..74d3bbe1fcc 100644 --- a/unittests/ADT/TypeTraitsTest.cpp +++ b/unittests/ADT/TypeTraitsTest.cpp @@ -33,9 +33,6 @@ template struct CheckFunctionTraits { using FuncType = bool (*)(const int &); struct CheckFunctionPointer : CheckFunctionTraits {}; -static bool func(const int &v); -struct CheckFunctionPointer2 : CheckFunctionTraits {}; - /// Test method pointers. struct Foo { bool func(const int &v); @@ -43,7 +40,9 @@ struct Foo { struct CheckMethodPointer : CheckFunctionTraits {}; /// Test lambda references. -auto lambdaFunc = [](const int &v) -> bool { return true; }; +LLVM_ATTRIBUTE_UNUSED auto lambdaFunc = [](const int &v) -> bool { + return true; +}; struct CheckLambda : CheckFunctionTraits {}; } // end anonymous namespace @@ -70,7 +69,7 @@ static_assert(!is_detected::value, // is_invocable //===----------------------------------------------------------------------===// -static void invocable_fn(int) {} +void invocable_fn(int); static_assert(is_invocable::value, "expected function to be invocable");