diff options
Diffstat (limited to 'libcxxabi/test/catch_array_01.pass.cpp')
-rw-r--r-- | libcxxabi/test/catch_array_01.pass.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libcxxabi/test/catch_array_01.pass.cpp b/libcxxabi/test/catch_array_01.pass.cpp new file mode 100644 index 00000000000..4997602a6d0 --- /dev/null +++ b/libcxxabi/test/catch_array_01.pass.cpp @@ -0,0 +1,30 @@ +//===---------------------- catch_array_01.cpp ----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// Can you have a catch clause of array type that catches anything? + +#include <cassert> + +int main() +{ + typedef char Array[4]; + Array a = {'H', 'i', '!', 0}; + try + { + throw a; // converts to char* + assert(false); + } + catch (Array& b) // can't catch char* + { + assert(false); + } + catch (...) + { + } +} |