[PATCH] D28034: [ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 22 01:13:28 PST 2016


Prazek added inline comments.


================
Comment at: docs/LibASTMatchersReference.html:2442
   };
-fieldDecl(isBitField())
+fieldDecl(hasBitWidth(2))
   matches 'int a;' and 'int c;' but not 'int b;'.
----------------
Fix not connected to patch?


================
Comment at: docs/LibASTMatchersReference.html:4763
+fieldDecl(hasInClassInitializer(integerLiteral(equals(2))))
+  matches 'int a;' but not 'int b;'.
+</pre></td></tr>
----------------
It would be good to add int c; without initializer and show that fieldDecl(hasInClassInitializer(anything())) will match to a and b


================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:547
 /// \endcode
-/// fieldDecl(isBitField())
+/// fieldDecl(hasBitWidth(2))
 ///   matches 'int a;' and 'int c;' but not 'int b;'.
----------------
Samw


https://reviews.llvm.org/D28034





More information about the cfe-commits mailing list