This is similar to D45650. Constructors of pass-by-value arguments aren't similar to other temporary constructors, we should treat them differently. For now we don't handle them, so we shouldn't produce temporary-like construction contexts for them. D45650 fixed this bug for call-expressions, but construct-expressions and Objective-C message expressions both aren't call-expressions, so they need a separate fix.
Diff Detail
Event Timeline
lib/Analysis/CFG.cpp | ||
---|---|---|
2397 | Would appreciate a top-level comment that this is specifically for constructors passing arguments by value. | |
4284 | I think we can do better then duplicating the same code block three times with an exact comment as well. I do understand that it's painful due to call expressions not having a common superclass, but maybe it would be sufficient to just have a function iterating over arguments? |
Minor nit: request for code reuse.
lib/Analysis/CFG.cpp | ||
---|---|---|
694 | Who needs inheritance if one has templates. | |
lib/Analysis/ConstructionContext.cpp | ||
115–117 | Could we refactor the check into isCallable or whatever would be the appropriate name here? |
Who needs inheritance if one has templates.
This is pretty bad though, I wish we could add another interface to those three, if anything just to have arguments()