aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2018-05-15 20:08:15 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2018-05-15 20:08:15 +0000
commitec8598efb17216c0f4c93040ac1b40f97ae01fc7 (patch)
tree39cad34270225627fd61f9b0cbf514b6e6775ea5 /llvm/unittests/Support/CommandLineTest.cpp
parentf13c9969fc099abe3b539714d69ab01028637c29 (diff)
downloadllvm-ec8598efb17216c0f4c93040ac1b40f97ae01fc7.zip
llvm-ec8598efb17216c0f4c93040ac1b40f97ae01fc7.tar.gz
llvm-ec8598efb17216c0f4c93040ac1b40f97ae01fc7.tar.bz2
Use perfect forwarding to deduplicate code in unit test. NFC.
llvm-svn: 332388
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index 8e5e9ad..ba12c84 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -54,28 +54,8 @@ class TempEnvVar {
template <typename T, typename Base = cl::opt<T>>
class StackOption : public Base {
public:
- // One option...
- template<class M0t>
- explicit StackOption(const M0t &M0) : Base(M0) {}
-
- // Two options...
- template<class M0t, class M1t>
- StackOption(const M0t &M0, const M1t &M1) : Base(M0, M1) {}
-
- // Three options...
- template<class M0t, class M1t, class M2t>
- StackOption(const M0t &M0, const M1t &M1, const M2t &M2) : Base(M0, M1, M2) {}
-
- // Four options...
- template<class M0t, class M1t, class M2t, class M3t>
- StackOption(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3)
- : Base(M0, M1, M2, M3) {}
-
- // Five options...
- template <class M0t, class M1t, class M2t, class M3t, class M4t>
- StackOption(const M0t &M0, const M1t &M1, const M2t &M2, const M3t &M3,
- const M4t &M4)
- : Base(M0, M1, M2, M3, M4) {}
+ template <class... Ts>
+ explicit StackOption(Ts &&... Ms) : Base(std::forward<Ts>(Ms)...) {}
~StackOption() override { this->removeArgument(); }