1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // GCC incorrectly allows PMF type "void (T::*)()" to be caught as "void (T::*)() const"
10 // See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69375
12 // UNSUPPORTED: no-exceptions
21 typedef void (A::*mf1
)();
22 typedef void (A::*mf2
)() const;
28 typedef void (B::*dmf1
)();
29 typedef void (B::*dmf2
)() const;
32 bool can_convert(Tp
) { return true; }
35 bool can_convert(...) { return false; }
108 assert(!can_convert
<mf1
>((dmf1
)0));
109 assert(!can_convert
<mf2
>((dmf1
)0));
127 assert(!can_convert
<mf1
>((dmf2
)0));
128 assert(!can_convert
<mf2
>((dmf2
)0));
149 assert(!can_convert
<void*>(&A::foo
));
164 int main(int, char**)