Skip to content

Commit 45c4f3f

Browse files
authored
Merge pull request #18914 from github/esteffin/bmn-include-file-resolution-statistics
C++ query to extract the number of errors due to include file resolution failure
2 parents c22b05a + e230166 commit 45c4f3f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @name Include file resolution status
3+
* @description A count of successful includes and includes that failed to resolve.
4+
* This query is for internal use only and may change without notice.
5+
* @kind table
6+
* @id cpp/include-resolution-status
7+
*/
8+
9+
import cpp
10+
11+
/**
12+
* A cannot open file error.
13+
*
14+
* Typically this is due to a missing include.
15+
*/
16+
class CannotOpenFileError extends CompilerError {
17+
CannotOpenFileError() { this.hasTag(["cannot_open_file", "cannot_open_file_reason"]) }
18+
}
19+
20+
select count(CannotOpenFileError e) as failed_includes, count(Include i) as successful_includes

0 commit comments

Comments
 (0)