libstdc++: Fix test that fails for C++98
Local classes have no linkage so cannot be used as template arguments in C++98. libstdc++-v3/ChangeLog: * testsuite/20_util/specialized_algorithms/uninitialized_fill_n/sizes.cc: Move struct to namespace scope.
This commit is contained in:
parent
dc8c00966e
commit
f07fa7a31c
@ -31,19 +31,19 @@ test01()
|
||||
VERIFY( i[3] == 0 );
|
||||
}
|
||||
|
||||
// The standard only requires that n>0 and --n are valid expressions.
|
||||
struct Size
|
||||
{
|
||||
int value;
|
||||
|
||||
void operator--() { --value; }
|
||||
|
||||
int operator>(void*) { return value != 0; }
|
||||
};
|
||||
|
||||
void
|
||||
test02()
|
||||
{
|
||||
// The standard only requires that n>0 and --n are valid expressions.
|
||||
struct Size
|
||||
{
|
||||
int value;
|
||||
|
||||
void operator--() { --value; }
|
||||
|
||||
int operator>(void*) { return value != 0; }
|
||||
};
|
||||
|
||||
int i[5] = { };
|
||||
Size n = {4};
|
||||
std::uninitialized_fill_n(i, n, 0xdcba);
|
||||
|
Loading…
Reference in New Issue
Block a user