mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Merge pull request #15300 from github/sashabu/uuidof
C++: Add a test with `__uuidof` in a template.
This commit is contained in:
@@ -17,4 +17,9 @@ void GetUUID() {
|
||||
uuid = __uuidof(s);
|
||||
uuid = __uuidof(0);
|
||||
}
|
||||
|
||||
template <typename Placeholder, typename ...>
|
||||
auto Wrapper = __uuidof(Placeholder);
|
||||
auto inst = Wrapper<S>;
|
||||
|
||||
// semmle-extractor-options: --microsoft
|
||||
|
||||
@@ -12,3 +12,5 @@ uuidofOperators
|
||||
| uuidof.cpp:15:12:15:29 | __uuidof(S) | const _GUID | 01234567-89ab-cdef-0123-456789abcdef |
|
||||
| uuidof.cpp:17:12:17:22 | __uuidof(S) | const _GUID | 01234567-89ab-cdef-0123-456789abcdef |
|
||||
| uuidof.cpp:18:12:18:22 | __uuidof(0) | const _GUID | 00000000-0000-0000-0000-000000000000 |
|
||||
| uuidof.cpp:22:16:22:36 | __uuidof(Placeholder) | const _GUID | |
|
||||
| uuidof.cpp:22:16:22:36 | __uuidof(S) | const _GUID | 01234567-89ab-cdef-0123-456789abcdef |
|
||||
|
||||
@@ -5,6 +5,6 @@ query predicate classUuids(Class cls, string uuid) {
|
||||
}
|
||||
|
||||
query predicate uuidofOperators(UuidofOperator op, string type, string uuid) {
|
||||
uuid = op.getValue() and
|
||||
(if exists(op.getValue()) then uuid = op.getValue() else uuid = "") and
|
||||
type = op.getType().toString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user