summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/casts.cpp
blob: 436b722e69d2714d6dfc672f39986f6b68d6fe44 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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;
}