-Wfree-nonheap-object warning fix using gcc-11

This commit is contained in:
William S Fulton 2021-11-12 08:03:33 +00:00
commit 6cafc93135

View file

@ -61,7 +61,11 @@ void CheckRetTypemapUsed() {
%inline {
class FFoo {
public:
char * Bar(bool b) const { return (char *)"x"; }
char * Bar(bool b) const {
char *ret = new char[2];
strcpy(ret, b ? "1" : "0");
return ret;
}
};
}