[PATCH] D65944: [clang] Update `ignoringElidableConstructorCall` matcher to ignore `ExprWithCleanups`.

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 06:25:52 PDT 2019


gribozavr accepted this revision.
gribozavr added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:6538
 ///
-/// In C++17 copy elidable constructors are no longer being
-/// generated in the AST as it is not permitted by the standard. They are
-/// however part of the AST in C++14 and earlier. Therefore, to write a matcher
-/// that works in all language modes, the matcher has to skip elidable
-/// constructor AST nodes if they appear in the AST. This matcher can be used to
-/// skip those elidable constructors.
+/// In C++17 copy elidable constructors are no longer being generated in the AST
+/// as it is not permitted by the standard. They are, however, part of the AST
----------------
while you're editing it: "elidable copy constructors"


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:6540
+/// as it is not permitted by the standard. They are, however, part of the AST
+/// in C++14 and earlier. So, a matcher must elide these differences to work in
+/// all language modes. This matcher supports such elision by skipping elidable
----------------
"elide these differences" => "abstract over these differences"?


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:6541
+/// in C++14 and earlier. So, a matcher must elide these differences to work in
+/// all language modes. This matcher supports such elision by skipping elidable
+/// constructor-call AST nodes, `ExprWithCleanups` nodes wrapping elidable
----------------
"This matcher skips elidable constructor call AST nodes, ... "?


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:6556
 ///
-/// ``varDecl(hasInitializer(any(
-///       ignoringElidableConstructorCall(callExpr()),
-///       exprWithCleanups(ignoringElidableConstructorCall(callExpr()))))``
-/// matches ``H D = G()``
+/// ``varDecl(hasInitializer(ignoringElidableConstructorCall(callExpr())))``
+/// matches ``H D = G()`` in C++11 through C++17 (and beyond).
----------------
Could you add this matcher as a test?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65944/new/

https://reviews.llvm.org/D65944





More information about the cfe-commits mailing list