Make string_view work with -fno-exceptions and get tests passing.

llvm-svn: 271237
diff --git a/libcxx/test/std/experimental/string.view/string.view.access/at.pass.cpp b/libcxx/test/std/experimental/string.view/string.view.access/at.pass.cpp
index 46804d4..af35f54 100644
--- a/libcxx/test/std/experimental/string.view/string.view.access/at.pass.cpp
+++ b/libcxx/test/std/experimental/string.view/string.view.access/at.pass.cpp
@@ -10,7 +10,7 @@
 // NOTE: Older versions of clang have a bug where they fail to evalute
 // string_view::at as a constant expression.
 // XFAIL: clang-3.4, clang-3.3
-// XFAIL: libcpp-no-exceptions
+
 
 // <string_view>
 
@@ -20,6 +20,8 @@
 #include <stdexcept>
 #include <cassert>
 
+#include "test_macros.h"
+
 template <typename CharT>
 void test ( const CharT *s, size_t len ) {
     std::experimental::basic_string_view<CharT> sv ( s, len );
@@ -27,11 +29,13 @@
     for ( size_t i = 0; i < len; ++i ) {
         assert (  sv.at(i) == s[i] );
         assert ( &sv.at(i) == s + i );
-        }
+    }
 
+#ifndef TEST_HAS_NO_EXCEPTIONS
     try { sv.at(len); } catch ( const std::out_of_range & ) { return ; }
     assert ( false );
-    }
+#endif
+}
     
 int main () {
     test ( "ABCDE", 5 );
@@ -40,7 +44,7 @@
     test ( L"ABCDE", 5 );
     test ( L"a", 1 );
 
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
     test ( u"ABCDE", 5 );
     test ( u"a", 1 );
 
@@ -48,7 +52,7 @@
     test ( U"a", 1 );
 #endif
 
-#if __cplusplus >= 201103L
+#if TEST_STD_VER >= 11
     {
     constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 );
     static_assert ( sv.length() ==  2,  "" );