Skip to content

Commit

Permalink
Add missing function in 20_util/exchange/1.cc.
Browse files Browse the repository at this point in the history
When this test is compiled at -O0, the compiler does not remove the
address comparison. This causes a link failure, since the body of f()
is missing.

	* testsuite/20_util/exchange/1.cc: Add missing function
	bodies.

From-SVN: r203629
  • Loading branch information
dnovillo authored and Diego Novillo committed Oct 15, 2013
1 parent 1602204 commit 37ea0d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions libstdc++-v3/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-10-15 Diego Novillo <[email protected]>

* testsuite/20_util/exchange/1.cc: Add missing function
bodies.

2013-10-15 Tim Shen <[email protected]>

PR libstdc++/58737
Expand Down
6 changes: 4 additions & 2 deletions libstdc++-v3/testsuite/20_util/exchange/1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ test02()
VERIFY( old.value == 1 );
}

int f(int) { return 0; }

double f(double) { return 0; }

// Deduce type of overloaded function
void
test03()
{
bool test __attribute__((unused)) = true;

int (*fp)(int);
int f(int);
double f(double);
std::exchange(fp, &f);
VERIFY( fp != nullptr );
}
Expand Down

0 comments on commit 37ea0d8

Please sign in to comment.