C++: Add a testcase that demonstrates the problem with MaD and typedefs.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-01-02 11:10:13 +01:00
parent f23e56bdca
commit 5ccc12cea1
3 changed files with 26 additions and 0 deletions

View File

@@ -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
}