Skip to content

Commit

Permalink
Remove unnecessary template specifiers from truct constructors in tests.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jensmassberg committed Jan 10, 2023
1 parent f8feb64 commit 2a43b50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions llvm/unittests/IR/PassBuilderCallbacksTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <>
Expand All @@ -247,7 +247,7 @@ struct MockAnalysisHandle<Function>
MOCK_METHOD3(invalidate, bool(Function &, const PreservedAnalyses &,
FunctionAnalysisManager::Invalidator &));

MockAnalysisHandle<Function>() { setDefaults(); }
MockAnalysisHandle() { setDefaults(); }
};

template <>
Expand All @@ -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 <>
Expand All @@ -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) {
Expand Down

0 comments on commit 2a43b50

Please sign in to comment.