[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-22 Thread Julie Hockett via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC323158: Add hasTrailingReturn AST matcher (authored by juliehockett, committed by ). Repository: rC Clang https://reviews.llvm.org/D42273 Files: docs/LibASTMatchersReference.html

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM! https://reviews.llvm.org/D42273 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-22 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett updated this revision to Diff 130908. juliehockett added a comment. Adding test case -- thank you for the advice! https://reviews.llvm.org/D42273 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h lib/ASTMatchers/Dynamic/Registry.cpp

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:5904 +return F->hasTrailingReturn(); + return false; +} aaron.ballman wrote: > lebedev.ri wrote: > > juliehockett wrote: > > > lebedev.ri wrote: > > > > There are no

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:5904 +return F->hasTrailingReturn(); + return false; +} lebedev.ri wrote: > juliehockett wrote: > > lebedev.ri wrote: > > > There are no negative tests in the unittest

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:5904 +return F->hasTrailingReturn(); + return false; +} juliehockett wrote: > lebedev.ri wrote: > > There are no negative tests in the unittest that cover this false path.

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-19 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:5904 +return F->hasTrailingReturn(); + return false; +} lebedev.ri wrote: > There are no negative tests in the unittest that cover this false path. Is there a test case

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-19 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:5904 +return F->hasTrailingReturn(); + return false; +} There are no negative tests in the unittest that cover this false path. https://reviews.llvm.org/D42273

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM with a minor commenting/documentation nit. Comment at: include/clang/ASTMatchers/ASTMatchers.h:5898 +/// \code +/// int X() {}; +/// auto Y() -> int {};

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-19 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett updated this revision to Diff 130671. juliehockett marked 2 inline comments as done. juliehockett added a comment. Updating matcher and fixing semicolons https://reviews.llvm.org/D42273 Files: docs/LibASTMatchersReference.html include/clang/ASTMatchers/ASTMatchers.h

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/ASTMatchers/ASTMatchers.h:5902 +AST_MATCHER(FunctionDecl, hasTrailingReturn) { + return Node.getType()->castAs()->hasTrailingReturn(); +} I think this may cause failed assertions on code like `void

[PATCH] D42273: Add hasTrailingReturn AST matcher

2018-01-18 Thread Julie Hockett via Phabricator via cfe-commits
juliehockett created this revision. juliehockett added a reviewer: aaron.ballman. Herald added a subscriber: klimek. Adds AST matcher for a FunctionDecl that has a trailing return type. https://reviews.llvm.org/D42273 Files: docs/LibASTMatchersReference.html