This is an archive of the discontinued LLVM Phabricator instance.

[ASTMatchers] Matchers for new[] operators
ClosedPublic

Authored by baloghadamsoftware on Oct 27 2017, 2:15 AM.

Details

Summary

Two new matchers for CXXNewExpr are added which may be useful e.g. in clang-tidy checkers. One of them is isArrayForm which matches new[] but not plain new. The other one, hasArraySize matches new[] for a given size.

Diff Detail

Event Timeline

baloghadamsoftware edited the summary of this revision. (Show Details)Oct 27 2017, 2:16 AM
baloghadamsoftware edited the summary of this revision. (Show Details)
aaron.ballman added inline comments.
include/clang/ASTMatchers/ASTMatchers.h
5772

We typically try to match the AST method names with the matcher names when possible, so this should be named isArray().

Matcher renamed to isArray.

baloghadamsoftware marked an inline comment as done.Oct 27 2017, 6:03 AM
This revision is now accepted and ready to land.Oct 27 2017, 6:09 AM