================
@@ -815,13 +815,16 @@ void Sema::ActOnAnnotModuleEnd(SourceLocation EomLoc, 
Module *Mod) {
   // ImportDecl as we would for an imported module.
   FileID File = getSourceManager().getFileID(EomLoc);
   SourceLocation DirectiveLoc;
-  if (EomLoc == getSourceManager().getLocForEndOfFile(File)) {
+  SourceLocation IncludeLoc = getSourceManager().getIncludeLoc(File);
+  if (EomLoc == getSourceManager().getLocForEndOfFile(File) &&
+      IncludeLoc.isValid()) {
----------------
hongtaihu wrote:

The added regression test passes with the fix and reproduces the original 
assertion when the fix is reverted.

https://github.com/llvm/llvm-project/pull/225099
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to