From e2e2001260406bcfa0c636e00be3bc34808f8968 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Sep 2021 08:45:01 +0200 Subject: Add diag_frame around export stub loading This gives the location of the importer in case the export stub issues any diagnostics. --- libbuild2/file.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libbuild2/file.cxx') diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx index 0977895..1eb20ad 100644 --- a/libbuild2/file.cxx +++ b/libbuild2/file.cxx @@ -2575,8 +2575,17 @@ namespace build2 // @@ Should we verify these are all unqualified names? Or maybe there // is a use-case for the export stub to return a qualified name? // - parser p (ctx); - names v (p.parse_export_stub (ifs, path_name (es), gs, ts)); + names v; + { + auto df = make_diag_frame ( + [&tgt, &loc] (const diag_record& dr) + { + dr << info (loc) << "while loading export stub for " << tgt; + }); + + parser p (ctx); + v = p.parse_export_stub (ifs, path_name (es), gs, ts); + } // If there were no export directive executed in an export stub, // assume the target is not exported. -- cgit v1.1