Skip to content

Commit 858054b

Browse files
committed
test_ptr_fun: Re-enable tests of overloaded functions
1 parent d806222 commit 858054b

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

tests/test_ptr_fun.cc

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
#include "testutilities.h"
66
#include <sigc++/sigc++.h>
77

8-
// TODO: put something like #ifndef FORTE ... #else ... #endif around:
9-
#define ENABLE_TEST_OF_OVERLOADED_FUNCTIONS 0
10-
118
namespace
129
{
1310
std::ostringstream result_stream;
@@ -28,22 +25,19 @@ foo(int i1)
2825
result_stream << "foo(int " << i1 << ")";
2926
}
3027

31-
#if ENABLE_TEST_OF_OVERLOADED_FUNCTIONS
3228
void
3329
bar(char i1)
3430
{
3531
result_stream << "bar(char " << (int)i1 << ")";
3632
}
37-
#endif
3833

39-
// TODO: This works with clang++ (when we specify the return type, such as
40-
// int or void, but doesn't work with g++.
41-
/*
34+
// Note: This doesn't work with some older versions of g++,
35+
// even when we specify the return type.
36+
// Hopefully those g++ versions are old enough now.
4237
void bar(float i1)
4338
{
4439
result_stream << "bar(float " << i1 << ")";
4540
}
46-
*/
4741

4842
double
4943
bar(int i1, int i2)
@@ -77,19 +71,16 @@ main(int argc, char* argv[])
7771
sigc::ptr_fun<void> (&foo)(1);
7872
util->check_result(result_stream, "foo(int 1)");
7973

80-
// Test use of overloaded functions that differ by parameter type:
81-
#if ENABLE_TEST_OF_OVERLOADED_FUNCTIONS
74+
// Test use of overloaded functions that differ by parameter type:
8275
sigc::ptr_fun<void, char> (&bar)(2);
8376
util->check_result(result_stream, "bar(char 2)");
8477

8578
sigc::ptr_fun<void, float> (&bar)(2.0f);
8679
util->check_result(result_stream, "bar(float 2)");
87-
#else
88-
// TODO: This works with clang++ (when we specify the return type, such as
89-
// int or void, but doesn't work with g++.
90-
// sigc::ptr_fun<void>(&bar)(2.0f);
91-
// util->check_result(result_stream, "bar(float 2)");
92-
#endif
80+
81+
// int or void, but doesn't work with g++.
82+
// sigc::ptr_fun<void>(&bar)(2.0f);
83+
// util->check_result(result_stream, "bar(float 2)");
9384

9485
sigc::ptr_fun<double> (&bar)(3, 5);
9586
util->check_result(result_stream, "bar(int 3, int 5)");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy