Fix #10469 FP returnTempReference with overloaded operator+=#3678
Conversation
| ValueType::MatchResult res = ValueType::matchParameter(call, funcVar->valueType()); | ||
| ValueType vt; | ||
| auto pvt = funcVar->valueType(); | ||
| if (pvt && funcVar->isArray()) { |
There was a problem hiding this comment.
Does this work when array is passed by reference(ie void f(const T (&array)[N]))? Maybe we should call matchParameter first and then if it doesn't match adjust the valuetype if funcVar->isArray()?
There was a problem hiding this comment.
It works in the sense that there is no FP if I change the test case accordingly. But ValueType can't store the dimension N anyway.
| { | ||
| ValueType::MatchResult res = ValueType::matchParameter(call, funcVar->valueType()); | ||
| ValueType vt; | ||
| auto pvt = funcVar->valueType(); |
There was a problem hiding this comment.
Maybe do ValueType vt = *funcVar->valueType(); and then just modify it directly.
There was a problem hiding this comment.
We have to check for nullptr first, otherwise there is a crash when running the tests.
|
There is a merge conflict. |
|
Now that I look at it again, |
Function parameters
const char* svs.const char s[]were not handled consistently inVariableandValueType. I'm not sure that this is the right fix.