mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Add more deduction guide tests
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import cpp
|
||||
|
||||
from DeductionGuide d
|
||||
where not exists(d.getTemplateClass())
|
||||
select d
|
||||
@@ -0,0 +1,5 @@
|
||||
| file://:0:0:0:0 | C | test.cpp:4:8:4:8 | C<T> |
|
||||
| file://:0:0:0:0 | C | test.cpp:4:8:4:8 | C<T> |
|
||||
| test.cpp:5:5:5:5 | (unnamed deduction guide) | test.cpp:4:8:4:8 | C<T> |
|
||||
| test.cpp:6:5:6:5 | (unnamed deduction guide) | test.cpp:4:8:4:8 | C<T> |
|
||||
| test.cpp:12:1:12:1 | C | test.cpp:4:8:4:8 | C<T> |
|
||||
@@ -3,6 +3,7 @@
|
||||
template<typename T>
|
||||
struct C {
|
||||
C(const T);
|
||||
C(char, char);
|
||||
};
|
||||
|
||||
C(const double) -> C<int>;
|
||||
@@ -10,6 +11,8 @@ C(const double) -> C<int>;
|
||||
template<typename T>
|
||||
C(const T) -> C<int>;
|
||||
|
||||
C(char, char) -> C<char>;
|
||||
|
||||
void test() {
|
||||
new C<char>(0);
|
||||
new C<int>(0);
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
| file://:0:0:0:0 | C | test.cpp:4:8:4:8 | C<T> |
|
||||
| test.cpp:5:5:5:5 | (unnamed deduction guide) | test.cpp:4:8:4:8 | C<T> |
|
||||
| test.cpp:11:1:11:1 | C | test.cpp:4:8:4:8 | C<T> |
|
||||
Reference in New Issue
Block a user