diff options
Diffstat (limited to 'clang/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp b/clang/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp new file mode 100644 index 0000000..38de271 --- /dev/null +++ b/clang/test/CodeGenCXX/2003-12-08-ArrayOfPtrToMemberFunc.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -emit-llvm %s -o - + +struct Evil { + void fun (); +}; +int foo(); +typedef void (Evil::*memfunptr) (); +static memfunptr jumpTable[] = { &Evil::fun }; + +void Evil::fun() { + (this->*jumpTable[foo()]) (); +} |