ReactOS 0.4.16-dev-197-g92996da
resolve_name.cpp
Go to the documentation of this file.
1#define _STLP_DO_IMPORT_CSTD_FUNCTIONS
2#include <cmath>
3
4#if !defined (STLPORT) || defined (_STLP_USE_NAMESPACES)
5
6namespace NS1 {
7
8bool f()
9{
10 double d( 1.0 );
11
12 d = sqrt( d );
13 d = ::sqrt( d );
14 d = std::sqrt( d );
15 return d == 1.0;
16}
17
18}
19
20namespace {
21
22bool g()
23{
24 double d( 1.0 );
25
26 d = sqrt( d );
27 d = ::sqrt( d );
28 d = std::sqrt( d );
29 return d == 1.0;
30}
31
32}
33
34// VC6 consider call to sqrt ambiguous as soon as using namespace std has
35// been invoked.
36#if !defined (STLPORT) || !defined (_STLP_MSVC) || (_STLP_MSVC >= 1300)
37using namespace std;
38#endif
39
40bool h()
41{
42 double d( 1.0 );
43
44 d = sqrt( d );
45 d = ::sqrt( d );
46 d = std::sqrt( d );
47 return d == 1.0;
48}
49
50struct sq
51{
52 sq() {}
53
54 double sqroot( double x ) {
55 using std::sqrt;
56 return sqrt(x);
57 }
58};
59
60#endif
61
62
63#if 0 // Do nothing, this should be compiled only
64
66
67class ResolveNameTest : public CPPUNIT_NS::TestCase
68{
69 CPPUNIT_TEST_SUITE(ResolveNameTest);
70 CPPUNIT_TEST(cstyle);
72
73protected:
74 void cstyle();
75};
76
77CPPUNIT_TEST_SUITE_REGISTRATION(ResolveNameTest);
78
79void ResolveNameTest::cstyle()
80{
81}
82
83#endif
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
#define CPPUNIT_TEST_SUITE_END()
Definition: cppunit_mini.h:191
#define CPPUNIT_TEST(X)
Definition: cppunit_mini.h:182
#define CPPUNIT_TEST_SUITE_REGISTRATION(X)
Definition: cppunit_mini.h:193
#define CPPUNIT_TEST_SUITE(X)
Definition: cppunit_mini.h:142
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define d
Definition: ke_i.h:81
bool f()
Definition: resolve_name.cpp:8
Definition: features.h:417
bool h()
double sqroot(double x)