Change std::conditional test to compile-only
authorJonathan Wakely <jwakely@redhat.com>
Sun, 31 Jul 2016 19:37:14 +0000 (20:37 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Sun, 31 Jul 2016 19:37:14 +0000 (20:37 +0100)
* testsuite/20_util/conditional/requirements/typedefs.cc: Change to
compile-only test.

From-SVN: r238930

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc

index baf979a0c72242bc8d52522906890e80450a576f..9bbfb4ca7c6659a123bbd23926617d665015d9c6 100644 (file)
@@ -1,5 +1,8 @@
 2016-07-31  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/20_util/conditional/requirements/typedefs.cc: Change to
+       compile-only test.
+
        * testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
        Ensure test is compiled with optimization.
 
index 5729cecec4c0ebc2865f7786ab839d994c70dfe8..c00db4155a5250385caeb89e5942943b4b041f37 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
 
 // 2007-05-02  Benjamin Kosnik  <bkoz@redhat.com>
 //
 // <http://www.gnu.org/licenses/>.
 
 #include <type_traits>
-#include <testsuite_hooks.h>
 
-void test01()
-{
-  bool test __attribute__((unused)) = true;
-  using std::conditional;
+using std::conditional;
+using std::is_same;
 
-  typedef conditional<true, char, int>::type     test1_type;
-  VERIFY( (std::is_same<test1_type, char>::value) );
+typedef conditional<true, char, int>::type     test1_type;
+static_assert( is_same<test1_type, char>::value, "conditional<true, ...>" );
   
-  typedef conditional<false, char, int>::type     test2_type;
-  VERIFY( (std::is_same<test2_type, int>::value) );
-}
-
-int main()
-{
-  test01();
-  return 0;
-}
+typedef conditional<false, char, int>::type     test2_type;
+static_assert( is_same<test2_type, int>::value, "conditional<false, ...>" );