Compare commits

..

2 Commits

Author SHA1 Message Date
f378c96f35 This commit was manufactured by cvs2svn to create branch
'function_signature_patches_1_31'.

[SVN r22633]
2004-04-13 12:19:16 +00:00
68545773d5 Changed tests to guarantee portability
[SVN r22245]
2004-02-12 11:29:47 +00:00
4 changed files with 10 additions and 5 deletions

View File

@ -10,9 +10,11 @@
//
// all these tests should fail:
//
typedef char a1[2];
typedef char a2[3];
// Namespace scope
BOOST_STATIC_ASSERT(sizeof(int) == sizeof(char)); // will not compile
BOOST_STATIC_ASSERT(sizeof(a1) == sizeof(a2)); // will not compile

View File

@ -10,11 +10,13 @@
//
// all these tests should fail:
//
typedef char a1[2];
typedef char a2[3];
// Function (block) scope
void f()
{
BOOST_STATIC_ASSERT(sizeof(int) == sizeof(char)); // should not compile
BOOST_STATIC_ASSERT(sizeof(a1) == sizeof(a2)); // should not compile
}

View File

@ -10,11 +10,13 @@
//
// this tests should fail:
//
typedef char a1[2];
typedef char a2[3];
struct Bob
{
private: // can be in private, to avoid namespace pollution
BOOST_STATIC_ASSERT(sizeof(int) == sizeof(char)); // will not compile
BOOST_STATIC_ASSERT(sizeof(a1) == sizeof(a2)); // will not compile
public:
// Member function scope: provides access to member variables
@ -26,7 +28,6 @@ struct Bob
BOOST_STATIC_ASSERT(sizeof(x) == 4);
BOOST_STATIC_ASSERT(sizeof(c) == 1);
#endif
//BOOST_STATIC_ASSERT((sizeof(x) == sizeof(c))); // should not compile
return x;
}
};

View File

@ -18,7 +18,7 @@ struct Bob
public:
// Member function scope: provides access to member variables
int x;
char x[4];
char c;
int f()
{