This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
can_rx_messages.insert(make_pair(can_id, this));
"src/can_service.cpp", line 130: remark #342-D: value copied to temporary, reference to temporary used can_rx_messages.insert(make_pair(can_id, this));
The above code works without issue on gcc and arm compilers. On thIs compiler the code generates a message shown above and crashes the program. can_rx_messages is a std::map with a uint32_t key and a custom Derived object pointer as the value.
For the source file can_service.cpp, please follow the directions in the article How to Submit a Compiler Test Case.
Thanks and regards,
-George
Oops, sorry. You don't need to send in a test case. This was first reported in this forum thread.
I'll add a note about this forum thread to the issue already filed.
Thanks and regards,
-George
On thIs compiler the code generates a message shown above and crashes the program.
Can you clarify how the program crashes?
While there is EXT_EP-9743 on the subject of the warning (remark #342-D) the existing bug doesn't seem to mention anything about the program crashing at runtime.
Hi Chester,
the program crashes on calling new. I traced the problem to the oem disabling heap in the linker file. The problem is resolved now. Although I still get a lot of warnings for reference to temporary when using the this pointer to add to a map of pointers.