blob: adef92c962bc0cd66a9ff6f20c6ee568d1e15c90 [file] [log] [blame]
Howard Hinnant4b3cb1c2012-02-01 19:42:45 +00001//===---------------------- catch_function_02.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?
Asiri Rathnayake4174e8b2016-05-31 12:01:32 +000011// UNSUPPORTED: libcxxabi-no-exceptions
Howard Hinnant4b3cb1c2012-02-01 19:42:45 +000012
13#include <cassert>
14
15void f() {}
16
17int main()
18{
19 typedef void Function();
20 try
21 {
22 throw f; // converts to void (*)()
23 assert(false);
24 }
25 catch (Function b) // equivalent to void (*)()
26 {
27 }
28 catch (...)
29 {
30 assert(false);
31 }
32}