MISRAC++2023-4.1.2_i (C++ only)
In this section:
Synopsis
(Advisory) Deprecated features should not be used
Enabled by default
No
Severity/Certainty
Low/Medium

Full description
Deprecated feature found [depr.temporary.buffer]
Coding standards
This check does not correspond to any coding standard rules.
Code examples
The following code example fails the check and will give a warning:
#include <memory>
#include <string>
void example(){
const std::string s[] = {"string", "1", "test", "..."};
const auto p = std::get_temporary_buffer<std::string>(4);
}
The following code example passes the check and will not give a warning about this issue:
#include <memory>
#include <string>
void example(){
const std::string s[] = {"string", "1", "test", "..."};
const auto p = new std::string[4];
}