[llvm] 2a43b50 - Remove unnecessary template specifiers from truct constructors in tests.
Jens Massberg via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 10 03:35:26 PST 2023
Author: Jens Massberg
Date: 2023-01-10T12:35:06+01:00
New Revision: 2a43b5038d9b218260c59cf0f9e171c9cec5ab25
URL: https://github.com/llvm/llvm-project/commit/2a43b5038d9b218260c59cf0f9e171c9cec5ab25
DIFF: https://github.com/llvm/llvm-project/commit/2a43b5038d9b218260c59cf0f9e171c9cec5ab25.diff
LOG: Remove unnecessary template specifiers from truct constructors in tests.
As far as I can see they are unnecessary and in C++20 they lead to errors.
Removing them the tests pass with C++20 and the default version.
Example error message:
```
llvm-project/llvm/unittests/IR/PassBuilderCallbacksTest.cpp:275:30: error: expected unqualified-id before ‘)’ token
275 | MockAnalysisHandle<Module>() { setDefaults(); }
```
Differential Revision: https://reviews.llvm.org/D141358
Added:
Modified:
llvm/unittests/IR/PassBuilderCallbacksTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/IR/PassBuilderCallbacksTest.cpp b/llvm/unittests/IR/PassBuilderCallbacksTest.cpp
index befdf03fce7cd..aac9a105ec0e2 100644
--- a/llvm/unittests/IR/PassBuilderCallbacksTest.cpp
+++ b/llvm/unittests/IR/PassBuilderCallbacksTest.cpp
@@ -236,7 +236,7 @@ struct MockAnalysisHandle<Loop>
MOCK_METHOD3_T(invalidate, bool(Loop &, const PreservedAnalyses &,
LoopAnalysisManager::Invalidator &));
- MockAnalysisHandle<Loop>() { this->setDefaults(); }
+ MockAnalysisHandle() { this->setDefaults(); }
};
template <>
@@ -247,7 +247,7 @@ struct MockAnalysisHandle<Function>
MOCK_METHOD3(invalidate, bool(Function &, const PreservedAnalyses &,
FunctionAnalysisManager::Invalidator &));
- MockAnalysisHandle<Function>() { setDefaults(); }
+ MockAnalysisHandle() { setDefaults(); }
};
template <>
@@ -261,7 +261,7 @@ struct MockAnalysisHandle<LazyCallGraph::SCC>
MOCK_METHOD3(invalidate, bool(LazyCallGraph::SCC &, const PreservedAnalyses &,
CGSCCAnalysisManager::Invalidator &));
- MockAnalysisHandle<LazyCallGraph::SCC>() { setDefaults(); }
+ MockAnalysisHandle() { setDefaults(); }
};
template <>
@@ -272,7 +272,7 @@ struct MockAnalysisHandle<Module>
MOCK_METHOD3(invalidate, bool(Module &, const PreservedAnalyses &,
ModuleAnalysisManager::Invalidator &));
- MockAnalysisHandle<Module>() { setDefaults(); }
+ MockAnalysisHandle() { setDefaults(); }
};
static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {
More information about the llvm-commits
mailing list