aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2016-07-31 19:37:14 +0000
committerJonathan Wakely <jwakely@redhat.com>2016-07-31 19:37:14 +0000
commite67760be8da7d25cc849b4d8558e84b287f9f6b3 (patch)
treefcac5f70e8650e4bb987445c06e761ab01ef3ec6
parent809f2fcb9a68d6f74b8f8fa071be1d5260e217d1 (diff)
Change std::conditional test to compile-only
* testsuite/20_util/conditional/requirements/typedefs.cc: Change to compile-only test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@238930 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog3
-rw-r--r--libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc24
2 files changed, 10 insertions, 17 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index baf979a0c72..9bbfb4ca7c6 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc b/libstdc++-v3/testsuite/20_util/conditional/requirements/typedefs.cc
index 5729cecec4c..c00db4155a5 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 <bkoz@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, ...>" );