Skip to content

Commit cb1d640

Browse files
committed
[clang][DepScan] resolve dangling reference to lambda that goes out of
scope. Fixes buildbots.
1 parent a2fbc9a commit cb1d640

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

clang/include/clang/Tooling/DependencyScanning/DependencyScanningTool.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,15 @@ class CallbackActionController : public DependencyActionController {
208208
public:
209209
virtual ~CallbackActionController();
210210

211+
static std::string lookupUnreachableModuleOutput(const ModuleDeps &MD,
212+
ModuleOutputKind Kind) {
213+
llvm::report_fatal_error("unexpected call to lookupModuleOutput");
214+
};
215+
211216
CallbackActionController(LookupModuleOutputCallback LMO)
212217
: LookupModuleOutput(std::move(LMO)) {
213218
if (!LookupModuleOutput) {
214-
LookupModuleOutput = [](const ModuleDeps &,
215-
ModuleOutputKind) -> std::string {
216-
llvm::report_fatal_error("unexpected call to lookupModuleOutput");
217-
};
219+
LookupModuleOutput = lookupUnreachableModuleOutput;
218220
}
219221
}
220222

0 commit comments

Comments
 (0)