mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 14:04:04 -05:00
The code here assumes a top-level AST subtree can be in 3 states: 1. The header line indicates it's system code (e.g. includes `/usr` etc.) 2. The header line indicates it's user code (includes `<source>`) 3. The header contains no such info (typically it includes `<invalid sloc>`) For the 3rd case this PR looks-ahead inside the current subtree and decides based on its contents. This is enough to filter out `<vector>` or `<string>` contents, as demonstrated in issue #5889 (added a test). This solution holds also for the case from issue #3849.