mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-25 06:40:18 +00:00
57e446dafa
Currently there is only support for a -fno-exceptions libc++ build. This is problematic for functions such as std::terminate() which are defined in libc++abi and using any of those functions throws away most of the benefits of using -fno-exceptions (code-size). This patch introduces a -fno-exceptions libc++abi build to address this issue. This new variant of libc++abi cannot be linked against any with-exceptions code as some symbols necessary for handling exceptions are missing in this library. Differential revision: http://reviews.llvm.org/D20677 Reviewers: EricWF, mclow.lists, bcraig llvm-svn: 271267
36 lines
888 B
C++
36 lines
888 B
C++
//===---------------------- 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?
|
|
|
|
// GCC incorrectly allows array types to be caught by reference.
|
|
// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69372
|
|
// XFAIL: gcc
|
|
// UNSUPPORTED: libcxxabi-no-exceptions
|
|
|
|
#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 (...)
|
|
{
|
|
}
|
|
}
|