Clang] Fix expansion of response files in -Wp after integrated-cc1 change
[llvm-project.git] / libcxxabi / test / catch_member_pointer_nullptr.pass.cpp
bloba6e74687692092b02f3814cf2297e1a36e5963f8
1 //===----------------- catch_member_pointer_nullptr.cpp -------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: libcxxabi-no-exceptions
11 #include <cassert>
13 #if __has_feature(cxx_nullptr)
15 struct A
17 const int i;
18 int j;
21 typedef const int A::*md1;
22 typedef int A::*md2;
24 void test1()
26 try
28 throw nullptr;
29 assert(false);
31 catch (md2 p)
33 assert(!p);
35 catch (md1)
37 assert(false);
41 void test2()
43 try
45 throw nullptr;
46 assert(false);
48 catch (md1 p)
50 assert(!p);
52 catch (md2)
54 assert(false);
58 #else
60 void test1()
64 void test2()
68 #endif
70 int main()
72 test1();
73 test2();