clang-contracts
clang-contracts copied to clipboard
Using self class pointer in contract
The following example should not fail:
class A { public: A * f() [[ensures r: r->valid()]] {} bool valid() const { return true; } };
But gives:
[Clang 6.0.0 x86_64 [clang-contracts] (b712feaf) #1] error: member access into incomplete type 'A'
This issue depends on late parsing of CXX11 attributes, but this feature is not yet implemented in Clang (it is for GNU attributes, though). Additionally, a message was sent to the cfe-dev mailing list; I will assume this if nobody replies.