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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203629 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
dnovillo committed Oct 15, 2013
1 parent 8943204 commit 0d19a5c
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 <dnovillo@google.com>

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

2013-10-15 Tim Shen <timshen91@gmail.com>

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 0d19a5c

Please sign in to comment.