[llvm-bugs] [Bug 34951] invalid argument type 'VMutex' to unary expression on requires_capability

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 27 14:39:26 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=34951

Aaron Puchert <aaronpuchert at alice-dsl.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |aaronpuchert at alice-dsl.net
         Resolution|---                         |INVALID

--- Comment #1 from Aaron Puchert <aaronpuchert at alice-dsl.net> ---
You need to define operator!() for VMutex, as shown in the documentation. The
expression in the attribute is parsed just like an ordinary C++ expression, so
the operator needs to be available for negative capabilities to work. The
implementation doesn't matter, you can just use

  const VMutex& operator!() const { return *this; }

as member function or

  const VMutex& operator!(const VMutex& mutex) { return mutex; }

as standalone function. I guess you can actually omit the implementation but I
didn't try if that links.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180827/64aca239/attachment.html>


More information about the llvm-bugs mailing list