aboutsummaryrefslogtreecommitdiffstats
path: root/test/FrontendC++/ptr-to-method-devirt.cpp
blob: 358b801af55695beb66339e71f7340de3a932553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// PR1602
// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | not grep ptrtoint
// RUN: %llvmgxx -c -emit-llvm %s -o - -O3 | llvm-dis | grep getelementptr | count 1


struct S { virtual void f(); };

typedef void (S::*P)(void);

const P p = &S::f; 

void g(S s) {
   (s.*p)();
 }