blob: 436b722e69d2714d6dfc672f39986f6b68d6fe44 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -emit-llvm -o %t
Anders Carlssonda921fd2009-10-19 18:14:28 +00002
3// PR5248
4namespace PR5248 {
5struct A {
6 void copyFrom(const A &src);
7 void addRef(void);
Douglas Gregorf2a55392009-12-22 22:47:22 +00008
9 A& operator=(int);
Anders Carlssonda921fd2009-10-19 18:14:28 +000010};
11
12void A::copyFrom(const A &src) {
13 ((A &)src).addRef();
14}
15}
16
Douglas Gregorf2a55392009-12-22 22:47:22 +000017// reinterpret_cast to self
18void test(PR5248::A* a) {
19 reinterpret_cast<PR5248::A&>(*a) = 17;
20}