aboutsummaryrefslogblamecommitdiff
path: root/test/CodeGenCXX/casts.cpp
blob: 436b722e69d2714d6dfc672f39986f6b68d6fe44 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                      





                              

                    






                                



                                        
// RUN: %clang_cc1 %s -emit-llvm -o %t

// PR5248
namespace PR5248 {
struct A {
  void copyFrom(const A &src);
  void addRef(void);

  A& operator=(int);
};

void A::copyFrom(const A &src) {
  ((A &)src).addRef();
}
}

// reinterpret_cast to self
void test(PR5248::A* a) {
  reinterpret_cast<PR5248::A&>(*a) = 17;
}