[PATCH] D49844: [AST] Add a isActuallyImplicitCast() helper to the CastExpr class.

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 26 06:22:31 PDT 2018


erichkeane added a comment.

I'm not sure that this logic requires a separate function.  Since you've fixed the getIsPartOfExplicitCast logic correctly, it is pretty simple...



================
Comment at: include/clang/AST/Expr.h:2854
+  /// There are two global types of casts - implicit and explicit.
+  /// The Explicit cast is something that was directly written in the source
+  /// code. And the implicit cast is expected to be the opposite.
----------------
These two sentences are both sentence fragments and should likely be joined.

A suggested alternative?
"An explicit cast corresponds to a cast written in the source code, while an implicit cast is materialized for the purposes of automatic conversions.


================
Comment at: include/clang/AST/Expr.h:3024
+inline bool CastExpr::isActuallyImplicitCast() const {
+  // If this is an Implicit cast, is it *NOT* a part of Explicit cast group?
+  if (auto *IC = dyn_cast<ImplicitCastExpr>(this))
----------------
Are you asking or telling?  I'd prefer this comment not be here, or explain the logic.


Repository:
  rC Clang

https://reviews.llvm.org/D49844





More information about the cfe-commits mailing list