jansvoboda11 wrote:

Ok, the comment below seems to suggests that the built-ins buffers are not 
considered to be part of any TU:

```c++
bool SourceManager::isBeforeInTranslationUnit(SourceLocation LHS,
                                              SourceLocation RHS) const {
  // ...

  if (isInTheSameTranslationUnit(LHS, RHS))
    return X;

  // If we arrived here, the location is either in a built-ins buffer or
  // associated with global inline asm. PR5662 and PR22576 are examples.

  // ...
}
```

I changed `SourceManager::isInTheSameTranslationUnit()` to check for that case 
explicitly instead of relying on the fact/bug that built-ins buffers happened 
to be assigned an untranslated include `SourceLocation`.

https://github.com/llvm/llvm-project/pull/66962
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to