diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2013-08-13 15:52:51 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2013-08-13 15:52:51 +0000 |
| commit | 914993df0b9927057c0981c83dd679e7307d6b27 (patch) | |
| tree | 68bc0bc7c7a7da2c13d1595d0465dfea91f16724 /libcxx/test/strings/string.conversions/stoul.pass.cpp | |
| parent | c14b59d1a1518caaeac83802c286558a4d1e12a3 (diff) | |
| download | bcm5719-llvm-914993df0b9927057c0981c83dd679e7307d6b27.tar.gz bcm5719-llvm-914993df0b9927057c0981c83dd679e7307d6b27.zip | |
Added more tests for numeric conversion error handing; Refs LWG issue 2009
llvm-svn: 188282
Diffstat (limited to 'libcxx/test/strings/string.conversions/stoul.pass.cpp')
| -rw-r--r-- | libcxx/test/strings/string.conversions/stoul.pass.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libcxx/test/strings/string.conversions/stoul.pass.cpp b/libcxx/test/strings/string.conversions/stoul.pass.cpp index 8cf37ebf9f7..41d11010783 100644 --- a/libcxx/test/strings/string.conversions/stoul.pass.cpp +++ b/libcxx/test/strings/string.conversions/stoul.pass.cpp @@ -84,4 +84,23 @@ int main() { assert(idx == 0); } +// LWG issue #2009 + try + { + std::stoul("9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } + catch (const std::out_of_range&) + { + assert(idx == 0); + } + try + { + std::stoul(L"9999999999999999999999999999999999999999999999999", &idx); + assert(false); + } + catch (const std::out_of_range&) + { + assert(idx == 0); + } } |

