mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
31 lines
587 B
C++
31 lines
587 B
C++
struct PM {
|
|
int x1;
|
|
int x2;
|
|
void f1();
|
|
void f2();
|
|
PM clone();
|
|
};
|
|
|
|
int PM::* getDataMemberPointer(bool);
|
|
|
|
typedef void (PM::*pmVoidVoid)();
|
|
pmVoidVoid getFunctionMemberPointer(bool);
|
|
|
|
int usePM(int PM::* pm) {
|
|
int acc;
|
|
|
|
PM obj;
|
|
|
|
// Needs fix for extractor bug CPP-313
|
|
//acc += obj.clone() .* getDataMemberPointer(true);
|
|
//acc += (&obj) ->* getDataMemberPointer(true);
|
|
|
|
(obj.clone() .* getFunctionMemberPointer(false))();
|
|
((&obj) ->* getFunctionMemberPointer(true))();
|
|
|
|
acc += obj .* pm;
|
|
acc += obj.clone() .* pm;
|
|
|
|
return acc;
|
|
}
|