summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
index 126ab2ce705..a21120bdfde 100644
--- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
+++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
@@ -12,8 +12,22 @@
// underlying_type
#include <type_traits>
+#include <climits>
int main()
{
-#error underlying_type is not implemented
+ enum E { V = INT_MIN };
+ enum F { W = UINT_MAX };
+
+ static_assert((std::is_same<std::underlying_type<E>::type, int>::value),
+ "E has the wrong underlying type");
+ static_assert((std::is_same<std::underlying_type<F>::type, unsigned>::value),
+ "F has the wrong underlying type");
+
+#if __has_feature(cxx_strong_enums)
+ enum G : char { };
+
+ static_assert((std::is_same<std::underlying_type<G>::type, char>::value),
+ "G has the wrong underlying type");
+#endif // __has_feature(cxx_strong_enums)
}
OpenPOWER on IntegriCloud