C++: Add getTemplateClass to DeductionGuide

This commit is contained in:
Jeroen Ketema
2024-08-01 13:44:19 +02:00
parent 377301a55a
commit 4dcf67940c
15 changed files with 10080 additions and 741 deletions

View File

@@ -0,0 +1,18 @@
// semmle-extractor-options: -std=c++20
template<typename T>
struct C {
C(const T);
};
C(const double) -> C<int>;
template<typename T>
C(const T) -> C<int>;
void test() {
new C<char>(0);
new C<int>(0);
new C(0.0f);
new C(0.0);
}

View File

@@ -0,0 +1,3 @@
| 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> |

View File

@@ -0,0 +1,4 @@
import cpp
from DeductionGuide d
select d, d.getTemplateClass()