[PATCH] D86699: [SyntaxTree] Ignore implicit non-leaf `CXXConstructExpr`

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 7 10:30:26 PDT 2020


gribozavr2 accepted this revision.
gribozavr2 added inline comments.


================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:48
 
+// Ignores the implicit `CXXConstructExpr` for copy/move constructors generated
+// by the compiler, as well as in implicit conversions like the one wrapping `1`
----------------
eduucaldas wrote:
> Please give feedback on this comments and should I comment the rest of the function?



================
Comment at: clang/lib/Tooling/Syntax/BuildTree.cpp:48-50
+// Ignores the implicit `CXXConstructExpr` for copy/move constructors generated
+// by the compiler, as well as in implicit conversions like the one wrapping `1`
+// in `X x = 1;`.
----------------
gribozavr2 wrote:
> eduucaldas wrote:
> > Please give feedback on this comments and should I comment the rest of the function?
> 
Seems straightforward to me.


================
Comment at: clang/unittests/Tooling/Syntax/BuildTreeTest.cpp:4042
+
+TEST_P(SyntaxTreeTest, ExplicitConversion_ZeroArguments) {
+  if (!GetParam().isCXX()) {
----------------
This is not a conversion, this is an explicit constructor call (CXXTemporaryObjectExpr) -- so please rename the test. Same for other tests below.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86699



More information about the cfe-commits mailing list