blob: 4997602a6d0e232ac3462cbc07e732ac684a50f9 [file] [log] [blame]
Dan Albert287553d2017-02-16 10:47:51 -08001//===---------------------- catch_array_01.cpp ----------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// Can you have a catch clause of array type that catches anything?
11
12#include <cassert>
13
14int main()
15{
16 typedef char Array[4];
17 Array a = {'H', 'i', '!', 0};
18 try
19 {
20 throw a; // converts to char*
21 assert(false);
22 }
23 catch (Array& b) // can't catch char*
24 {
25 assert(false);
26 }
27 catch (...)
28 {
29 }
30}