Repository navigation
[compiler-rt][sanitizer_common] Fix -Wunused-template in test helpers… - #207706
Merged
Merged
Conversation
… (NFC) Ident is a static function template in a test header, so any test TU that never calls it trips -Wunused-template. Drop static. check_locked in sanitizer_mutex_test.cpp has no callers. Remove it. Part of llvm#202945.
|
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Aditya Medhane (flash1729) Changes
Part of #202945. 2 Files Affected:
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_mutex_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_mutex_test.cpp
index 960427663480d..686dfe055c675 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_mutex_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_mutex_test.cpp
@@ -118,12 +118,6 @@ static void *read_write_thread(void *param) {
return 0;
}
-template<typename MutexType>
-static void check_locked(MutexType *mtx) {
- GenericScopedLock<MutexType> l(mtx);
- mtx->CheckLocked();
-}
-
TEST(SanitizerCommon, SpinMutex) {
SpinMutex mtx;
mtx.Init();
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h b/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h
index 5fd94a0281391..9cb60c397cd75 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h
@@ -72,9 +72,8 @@ inline void break_optimization(void *arg) {
// This function returns its parameter but in such a way that compiler
// can not prove it.
-template<class T>
-NOINLINE
-static T Ident(T t) {
+template <class T>
+NOINLINE T Ident(T t) {
T ret = t;
break_optimization(&ret);
return ret;
|
Member
Author
|
Ping for review @vitalybuka @vgvassilev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Identis a static function template in a test header, so any test TU that never calls it trips-Wunused-template. Drop static.check_lockedinsanitizer_mutex_test.cpphas no callers.Part of #202945.