From a029191d7e4fde3e41f1d8076980e7272fc7820a Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Thu, 8 Feb 2024 17:40:20 +0100
Subject: [PATCH] [irgen] Fix decl context of global ghost declarations

---
 framaCIRGen_src/ACSLComment.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/framaCIRGen_src/ACSLComment.cpp b/framaCIRGen_src/ACSLComment.cpp
index 72e4b97a..6a2c6c43 100644
--- a/framaCIRGen_src/ACSLComment.cpp
+++ b/framaCIRGen_src/ACSLComment.cpp
@@ -287,6 +287,7 @@ void ACSLComment::parseGhostGlobal(
   while (!parser->ParseTopLevelDecl(Decl)) {
 #endif
     clang::DeclGroupRef DGR = Decl.get();
+    for (auto decl: DGR) decl->setDeclContext(clangContext);
     consumer->HandleTopLevelDecl(DGR);
   }
   cpp.enableIncrementalProcessing(false);
-- 
GitLab