disable -Werror when building in release
Waffl3x opened this issue · 1 comments
I got the warning possibly dangling reference to a temporary warning
in GCC13 in the following places
https://github.com/foonathan/cppast/blob/main/src/code_generator.cpp#L554
https://github.com/foonathan/cppast/blob/main/src/cpp_entity.cpp#L16
I spent a lot of time looking over the code and I eventually came to the conclusion that there doesn't seem to be any bugs in the code, it's just a bug in GCC13. I'm pretty confident there are no actual problems, it's just some sort of false positive because of an lvalue reference resulting from a member function called on a prvalue. Normally this is bad, with the optional reference type you use it isn't a problem.
To avoid problems like this in the future, I believe -Werror should be disabled when being built as part of a subdirectory. I'm not much of a cmake expert so I don't know how achievable this would be but I believe it would be beneficial.
Good idea, I've implemented that.