clang-contracts icon indicating copy to clipboard operation
clang-contracts copied to clipboard

Using self class pointer in contract

Open jdgarciauc3m opened this issue 7 years ago • 1 comments

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'

jdgarciauc3m avatar Jun 07 '18 18:06 jdgarciauc3m

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.

jalopezg-git avatar Jun 25 '18 09:06 jalopezg-git