]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add missing function in 20_util/exchange/1.cc.
authorDiego Novillo <dnovillo@google.com>
Tue, 15 Oct 2013 18:51:37 +0000 (14:51 -0400)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Tue, 15 Oct 2013 18:51:37 +0000 (14:51 -0400)
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

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/exchange/1.cc

index b1d6e04d0e5430527a6964b52cb703a8c2c6ec47..ca453a9f296c4e42053684c44d55ce50759939b6 100644 (file)
@@ -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
index d16d9e9642e97d03b67b513c498ec106cc540d7a..2157b69e7e91dc1863416f0f167300d89072cec6 100644 (file)
@@ -55,6 +55,10 @@ test02()
   VERIFY( old.value == 1 );
 }
 
+int f(int) { return 0; }
+
+double f(double) { return 0; }
+
 // Deduce type of overloaded function
 void
 test03()
@@ -62,8 +66,6 @@ test03()
   bool test __attribute__((unused)) = true;
 
   int (*fp)(int);
-  int f(int);
-  double f(double);
   std::exchange(fp, &f);
   VERIFY( fp != nullptr );
 }