This can use static_assert instead of a runtime assert().

       * testsuite/20_util/conditional/requirements/typedefs.cc: Change to
        compile-only test.

Tested x86_64-linux, committed to trunk.

commit 26ae1ac1207f9cdc6d533eaa3c0786a2a09f5dac
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Sun Jul 31 20:35:34 2016 +0100

    Change std::conditional test to compile-only
    
        * testsuite/20_util/conditional/requirements/typedefs.cc: Change to
        compile-only test.

diff --git 
a/libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc 
b/libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc
index 5729cec..c00db41 100644
--- a/libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
 
 // 2007-05-02  Benjamin Kosnik  <b...@redhat.com>
 //
@@ -20,22 +20,12 @@
 // <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, ...>" );

Reply via email to