Merge pull request #11177 from github/redsun82/swift-decls

Swift: extract `PoundDiagnosticDecl` and `MissingMemberDecl`
This commit is contained in:
Paolo Tranquilli
2022-11-09 14:54:57 +01:00
committed by GitHub
17 changed files with 134 additions and 31 deletions

View File

@@ -1,4 +0,0 @@
// generated by codegen/codegen.py
After a swift source file is added in this directory and codegen/codegen.py is run again, test queries
will appear and this file will be deleted

View File

@@ -1,4 +0,0 @@
// generated by codegen/codegen.py
After a swift source file is added in this directory and codegen/codegen.py is run again, test queries
will appear and this file will be deleted

View File

@@ -0,0 +1,2 @@
| diagnostics.swift:2:1:2:25 | #warning(...) | getModule: | file://:0:0:0:0 | diagnostics | getKind: | 2 | getMessage: | diagnostics.swift:2:10:2:10 | I'm a warning |
| diagnostics.swift:3:1:3:26 | #error(...) | getModule: | file://:0:0:0:0 | diagnostics | getKind: | 1 | getMessage: | diagnostics.swift:3:8:3:8 | And I'm an error |

View File

@@ -0,0 +1,12 @@
// generated by codegen/codegen.py
import codeql.swift.elements
import TestUtils
from PoundDiagnosticDecl x, ModuleDecl getModule, int getKind, StringLiteralExpr getMessage
where
toBeTested(x) and
not x.isUnknown() and
getModule = x.getModule() and
getKind = x.getKind() and
getMessage = x.getMessage()
select x, "getModule:", getModule, "getKind:", getKind, "getMessage:", getMessage

View File

@@ -0,0 +1,3 @@
//codeql-extractor-expected-status: 1
#warning("I'm a warning")
#error("And I'm an error")