mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
As Doug pointed out (and I really should know), it is perfectly easy to
make VariadicFunction actually be trivial. Do so, and also make it look more like your standard trivial functor by making it a struct with no access specifiers. The unit test is updated to initialize its functors properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146827 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -22,7 +22,7 @@ std::string StringCatImpl(ArrayRef<const std::string *> Args) {
|
||||
S += *Args[i];
|
||||
return S;
|
||||
}
|
||||
const VariadicFunction<std::string, std::string, StringCatImpl> StringCat;
|
||||
const VariadicFunction<std::string, std::string, StringCatImpl> StringCat = {};
|
||||
|
||||
TEST(VariadicFunctionTest, WorksForClassTypes) {
|
||||
EXPECT_EQ("", StringCat());
|
||||
@ -45,7 +45,7 @@ long SumImpl(ArrayRef<const int *> Args) {
|
||||
Result += *Args[i];
|
||||
return Result;
|
||||
}
|
||||
const VariadicFunction<long, int, SumImpl> Sum;
|
||||
const VariadicFunction<long, int, SumImpl> Sum = {};
|
||||
|
||||
TEST(VariadicFunctionTest, WorksForPrimitiveTypes) {
|
||||
EXPECT_EQ(0, Sum());
|
||||
@ -65,7 +65,7 @@ int StringAppendImpl(std::string *Dest, ArrayRef<const std::string *> Args) {
|
||||
return Chars;
|
||||
}
|
||||
const VariadicFunction1<int, std::string *, std::string,
|
||||
StringAppendImpl> StringAppend;
|
||||
StringAppendImpl> StringAppend = {};
|
||||
|
||||
TEST(VariadicFunction1Test, Works) {
|
||||
std::string S0("hi");
|
||||
@ -93,7 +93,7 @@ void CountInRangeImpl(int *NumInRange, int Low, int High,
|
||||
++(*NumInRange);
|
||||
}
|
||||
const VariadicFunction3<void, int *, int, int, int,
|
||||
CountInRangeImpl> CountInRange;
|
||||
CountInRangeImpl> CountInRange = {};
|
||||
|
||||
TEST(VariadicFunction3Test, Works) {
|
||||
int N = -1;
|
||||
|
Reference in New Issue
Block a user