diff --git a/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp b/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp index 4820add7257..150c56914a9 100644 --- a/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp +++ b/Meta/Lagom/Tools/LibJSGCVerifier/src/CellsHandler.cpp @@ -210,6 +210,12 @@ void CollectCellsHandler::run(clang::ast_matchers::MatchFinder::MatchResult cons clang::DeclarationName const name = &result.Context->Idents.get("visit_edges"); auto const* visit_edges_method = record->lookup(name).find_first(); + if (!visit_edges_method && !fields_that_need_visiting.empty()) { + auto diag_id = diag_engine.getCustomDiagID(clang::DiagnosticsEngine::Warning, "JS::Cell-inheriting class %0 contains a GC-allocated member %1 but has no visit_edges method"); + auto builder = diag_engine.Report(record->getLocation(), diag_id); + builder << record->getName() + << fields_that_need_visiting[0]; + } if (!visit_edges_method || !visit_edges_method->getBody()) return;