GCC NRVO/RVO warning

Viewed 3362

Is there any warning, which allows us to know whether NRVO/RVO performed or not, in GCC?

I found that -fno-elide-constructors turns off NRVO/RVO, but NRVO/RVO has its own conditions to occur and sometimes does not occur. There is a need to know if NRVO/RVO occurs to understand, when extra copy-construction happens.

I am especially interested in compile-time features. It would be nice if there were some specific #pragma GCC... (which activates the diagnostic immediately following itself) or something using static assertion mechanism.

1 Answers
Related