Skip to content

Commit 4396c29

Browse files
committed
removed gcc conditional code.
1 parent 9251076 commit 4396c29

6 files changed

Lines changed: 3 additions & 69 deletions

File tree

CxxTestRegistration/src/AnimalRegistration.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ namespace test_mirror
4747
fns.push_back(rtl::type().member<Animal>()
4848
.methodStatic<const std::string&>(animal::str_updateZooKeeper)
4949
.build(&Animal::updateZooKeeper));
50-
51-
#if defined(__GNUC__) && !defined(__clang__)
5250
/*
5351
GCC here fails to automatically resolve the correct overloaded functor
5452
when both a lvalue reference and an rvalue overload exist.
@@ -71,22 +69,5 @@ namespace test_mirror
7169
fns.push_back(rtl::type().member<Animal>()
7270
.methodStatic<std::string&&>(animal::str_updateZooKeeper)
7371
.build(static_cast<std::string(*)(std::string&&)>(&Animal::updateZooKeeper))); //static method, taking rvalue reference as argument.
74-
#else
75-
fns.push_back(rtl::type().member<Animal>()
76-
.method<std::string&>(animal::str_setAnimalName)
77-
.build(&Animal::setAnimalName)); //overloaded method, taking non-const lvalue reference as argument.
78-
79-
fns.push_back(rtl::type().member<Animal>()
80-
.method<std::string&&>(animal::str_setAnimalName)
81-
.build(&Animal::setAnimalName)); //overloaded method, taking rvalue reference as argument.
82-
83-
fns.push_back(rtl::type().member<Animal>()
84-
.methodStatic<std::string&>(animal::str_updateZooKeeper)
85-
.build(&Animal::updateZooKeeper)); //static method, taking non-const lvalue reference as argument.
86-
87-
fns.push_back(rtl::type().member<Animal>()
88-
.methodStatic<std::string&&>(animal::str_updateZooKeeper)
89-
.build(&Animal::updateZooKeeper)); //static method, taking rvalue reference as argument.
90-
#endif
9172
}
9273
}

CxxTestRegistration/src/PodStdRegistration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace test_mirror
4646
* RTL will ignore this duplicate registration and retain the first one. Emits a warning on the console:
4747
* "[WARNING] Multiple registrations of the same type with different names detected."
4848
*/ fns.push_back(rtl::type().member<std::string>()
49-
.methodConst("empty")
49+
.methodConst<void>("empty")
5050
.build(&std::string::empty));
5151

5252
fns.push_back(rtl::type().ns("std")

CxxTestRegistration/src/StrConstRegistration.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ namespace test_mirror
3535
.build(&StrConst::reverseString));
3636

3737
// numereous other overloads.
38-
#if defined(__GNUC__) && !defined(__clang__)
3938
/*
4039
GCC here fails to automatically resolve the correct overloaded functor
4140
when both a lvalue reference and an rvalue overload exist.
@@ -54,19 +53,7 @@ namespace test_mirror
5453
fns.push_back(rtl::type().member<StrConst>()
5554
.methodConst<std::string&&>(str_reverseString)
5655
.build(static_cast<std::string(StrConst::*)(std::string&&) const>(&StrConst::reverseString)));
57-
#else
58-
fns.push_back(rtl::type().member<StrConst>()
59-
.methodConst<std::string&>(str_reverseString)
60-
.build(&StrConst::reverseString));
61-
62-
fns.push_back(rtl::type().member<StrConst>()
63-
.methodConst<std::string&&>(str_reverseString)
64-
.build(&StrConst::reverseString));
6556

66-
fns.push_back(rtl::type().member<StrConst>()
67-
.methodConst<const std::string&>(str_reverseString)
68-
.build(&StrConst::reverseString));
69-
#endif
7057
fns.push_back(rtl::type().member<StrConst>()
7158
.methodConst<std::string*>(str_reverseString)
7259
.build(&StrConst::reverseString));

CxxTestRegistration/src/StrFuncsRegistration.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace test_mirror
2323
fns.push_back(rtl::type().function<const char*>(str_reverseString)
2424
.build(reverseString));
2525
// numereous other overloads.
26-
#if defined(__GNUC__) && !defined(__clang__)
26+
2727
/*
2828
GCC here fails to automatically resolve the correct overloaded functor
2929
when both a lvalue reference and an rvalue overload exist.
@@ -39,16 +39,7 @@ namespace test_mirror
3939

4040
fns.push_back(rtl::type().function<std::string&&>(str_reverseString)
4141
.build(static_cast<std::string(*)(std::string&&)>(reverseString)));
42-
#else
43-
fns.push_back(rtl::type().function<std::string&>(str_reverseString)
44-
.build(reverseString));
45-
46-
fns.push_back(rtl::type().function<std::string&&>(str_reverseString)
47-
.build(reverseString));
4842

49-
fns.push_back(rtl::type().function<const std::string&>(str_reverseString)
50-
.build(reverseString));
51-
#endif
5243
fns.push_back(rtl::type().function<std::string*>(str_reverseString)
5344
.build(reverseString));
5445

CxxTestRegistration/src/StrMuteRegistration.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace test_mirror
3535
.build(&StrMute::reverseString));
3636

3737
// numereous other overloads.
38-
#if defined(__GNUC__) && !defined(__clang__)
38+
3939
/*
4040
GCC here fails to automatically resolve the correct overloaded functor
4141
when both a lvalue reference and an rvalue overload exist.
@@ -54,19 +54,7 @@ namespace test_mirror
5454
fns.push_back(rtl::type().member<StrMute>()
5555
.method<std::string&&>(str_reverseString)
5656
.build(static_cast<std::string(StrMute::*)(std::string&&)>(&StrMute::reverseString)));
57-
#else
58-
fns.push_back(rtl::type().member<StrMute>()
59-
.method<std::string&>(str_reverseString)
60-
.build(&StrMute::reverseString));
6157

62-
fns.push_back(rtl::type().member<StrMute>()
63-
.method<std::string&&>(str_reverseString)
64-
.build(&StrMute::reverseString));
65-
66-
fns.push_back(rtl::type().member<StrMute>()
67-
.method<const std::string&>(str_reverseString)
68-
.build(&StrMute::reverseString));
69-
#endif
7058
fns.push_back(rtl::type().member<StrMute>()
7159
.method<std::string*>(str_reverseString)
7260
.build(&StrMute::reverseString));

CxxTestRegistration/src/StrStaticRegistration.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ namespace test_mirror
3535
.build(&StrStatic::reverseString));
3636

3737
// numereous other overloads.
38-
#if defined(__GNUC__) && !defined(__clang__)
3938
/*
4039
GCC here fails to automatically resolve the correct overloaded functor
4140
when both a lvalue reference and an rvalue overload exist.
@@ -54,19 +53,7 @@ namespace test_mirror
5453
fns.push_back(rtl::type().member<StrStatic>()
5554
.methodStatic<std::string&&>(str_reverseString)
5655
.build(static_cast<std::string(*)(std::string&&)>(&StrStatic::reverseString)));
57-
#else
58-
fns.push_back(rtl::type().member<StrStatic>()
59-
.methodStatic<std::string&>(str_reverseString)
60-
.build(&StrStatic::reverseString));
61-
62-
fns.push_back(rtl::type().member<StrStatic>()
63-
.methodStatic<std::string&&>(str_reverseString)
64-
.build(&StrStatic::reverseString));
6556

66-
fns.push_back(rtl::type().member<StrStatic>()
67-
.methodStatic<const std::string&>(str_reverseString)
68-
.build(&StrStatic::reverseString));
69-
#endif
7057
fns.push_back(rtl::type().member<StrStatic>()
7158
.methodStatic<std::string*>(str_reverseString)
7259
.build(&StrStatic::reverseString));

0 commit comments

Comments
 (0)