Skip to content

Commit 4e6c988

Browse files
committed
[review-fix] document our options for the fixme
1 parent fa0a379 commit 4e6c988

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/lib/StaticAnalyzer/Checkers/StoreToImmutableChecker.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ static bool isInitializationContext(const Stmt *S, CheckerContext &C) {
6363
// ugly hack to detect whether this construction is used to initialize a
6464
// variable.
6565
//
66-
// FIXME: This should be eliminated once the API of checkBind would allow to
67-
// distinguish between initialization and assignment, because this information
68-
// is already available in the engine, it is just not passed to the checker
69-
// API.
66+
// FIXME: This should be eliminated by improving the API of checkBind to
67+
// ensure that it consistently passes the `VarDecl` (instead of the
68+
// `CXXConstructExpr`) when the constructor call denotes the initialization
69+
// of a variable with a lambda, or maybe less preferably, try the more
70+
// invasive approach of passing the information forward to the checkers
71+
// whether the current bind is an initialization or an assignment.
7072
const auto *ConstructExp = dyn_cast<CXXConstructExpr>(S);
7173
return ConstructExp && ConstructExp->isElidable();
7274
}

0 commit comments

Comments
 (0)