mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C++: Add a testcase that demonstrates the problem with MaD and typedefs.
This commit is contained in:
@@ -452,3 +452,16 @@ void test_function_pointers() {
|
||||
madCallReturnValueIgnoreFunction(&sink, source());
|
||||
sink(madCallReturnValueIgnoreFunction(&dontUseValue, source())); // $ ir
|
||||
}
|
||||
|
||||
template<typename X>
|
||||
struct StructWithTypedefInParameter {
|
||||
typedef X Type;
|
||||
X& parameter_ref_to_return_ref(const Type& x); // $ MISSING: interpretElement
|
||||
};
|
||||
|
||||
void test_parameter_ref_to_return_ref() {
|
||||
int x = source();
|
||||
StructWithTypedefInParameter<int> s;
|
||||
int y = s.parameter_ref_to_return_ref(x);
|
||||
sink(y); // $ MISSING: ir
|
||||
}
|
||||
Reference in New Issue
Block a user