1e434b34fSJonathan Roelofs //===---------------------- catch_array_02.cpp ----------------------------===//
2e434b34fSJonathan Roelofs //
3e434b34fSJonathan Roelofs //                     The LLVM Compiler Infrastructure
4e434b34fSJonathan Roelofs //
5e434b34fSJonathan Roelofs // This file is dual licensed under the MIT and the University of Illinois Open
6e434b34fSJonathan Roelofs // Source Licenses. See LICENSE.TXT for details.
7e434b34fSJonathan Roelofs //
8e434b34fSJonathan Roelofs //===----------------------------------------------------------------------===//
9e434b34fSJonathan Roelofs 
10e434b34fSJonathan Roelofs // Can you have a catch clause of array type that catches anything?
11*57e446daSAsiri Rathnayake // UNSUPPORTED: libcxxabi-no-exceptions
12e434b34fSJonathan Roelofs 
13e434b34fSJonathan Roelofs #include <cassert>
14e434b34fSJonathan Roelofs 
15e434b34fSJonathan Roelofs int main()
16e434b34fSJonathan Roelofs {
17e434b34fSJonathan Roelofs     typedef char Array[4];
18e434b34fSJonathan Roelofs     Array a = {'H', 'i', '!', 0};
19e434b34fSJonathan Roelofs     try
20e434b34fSJonathan Roelofs     {
21e434b34fSJonathan Roelofs         throw a;  // converts to char*
22e434b34fSJonathan Roelofs         assert(false);
23e434b34fSJonathan Roelofs     }
24e434b34fSJonathan Roelofs     catch (Array b)  // equivalent to char*
25e434b34fSJonathan Roelofs     {
26e434b34fSJonathan Roelofs     }
27e434b34fSJonathan Roelofs     catch (...)
28e434b34fSJonathan Roelofs     {
29e434b34fSJonathan Roelofs         assert(false);
30e434b34fSJonathan Roelofs     }
31e434b34fSJonathan Roelofs }
32