================
@@ -2474,6 +2487,38 @@ def is_assignment(self):
     Comma = 33
 
 
+class UnaryOperator(BaseEnumeration):
+    """
+    Describes the UnaryOperator of a declaration
+    """
+
+    def __nonzero__(self):
----------------
DeinAlptraum wrote:

It also doesn't seem to work the way the doc comments suggest:

```
import cindex 

print("PostInc nonzero:", cindex.UnaryOperator.PostInc.__nonzero__())
print("Invalid nonzero:", cindex.UnaryOperator.Invalid.__nonzero__())

if cindex.UnaryOperator.PostInc:
    print("PostInc is true")

if cindex.UnaryOperator.Invalid:
    print("Invalid is true")
```

```
~/.../python/clang >>> python att.py                            ±[●][219983] 
[8:52:21]
PostInc nonzero: True
Invalid nonzero: False
PostInc is true
Invalid is true

```

As this is copying the existing case from `BinaryOperator` we will have to fix 
that one separately as well.

https://github.com/llvm/llvm-project/pull/219983
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to