Match Objective-C object pointer type with nullability specificator in Clang's LibTooling
<p>Lets say I have such code:</p>

<pre><code>A* a = [[A alloc] init];
B* _Null_unspecified b = [[B alloc] init];
C* _Nullable c = [[C alloc] init];
D* _Nonnull d = [[D alloc] init];
</code></pre>

<p>Now, I want to create a matcher to match variables declaration.</p>

<p>Currently I have something like this:</p>

<pre><code>StatementMatcher NullUnspecifiedMatcher = 
  declStmt(hasSingleDecl(varDecl(hasType(objcObjectPointerType()))))`
</code></pre>

<p>There is <code>objcObjectPointerType()</code> but it matches only <code>a</code>. There are some pointers/references matchers, but they don't work on those variable declarations at all. Also, I tried <code>isAnyPointer()</code> but it works on any pointer, obj-c or not. </p>

<p>I tried <code>type()</code> to ensure, that I'm doing everything correctly, and it works.</p>

<p>So, how can I match only obj-c variable declarations, with or without nullability specifier?</p>

<p>Thanks!</p>