Hi all,

I think this has been visited every once in a while with regards to the
addition of move constructors, defaulted and deleted constructors, etc.
The following case magically works thanks to a pair of copy constructors
which are never used by the program, and breaks otherwise because of an
issue with the calling conventions.

As a consumer of the ABI document, I would appreciate if it mentioned the
known cases where it is not suitable for a compliant implementation of the
C++ language.

Thanks,


Hubert Tong

#include <cassert>

class A {
private:
#if ! REMOVE_COPY_CTOR
   A(const A &, void * = 0);
   A(const A &, bool = 0);
#endif

public:
   template <typename T>
   A(const volatile T &t) : a(t.a), b(a) { }

   A() : a(0), b(a) { }

   long a, &b;
};

long bar(A a) {
   ++a.b;
   return a.a;
}

int main() {
   volatile A a;
   long ret = bar(a);
   assert(ret == 1);
}
_______________________________________________
cxx-abi-dev mailing list
[email protected]
http://sourcerytools.com/cgi-bin/mailman/listinfo/cxx-abi-dev

Reply via email to