[clang] [clang] Restrict -Wnrvo to C++ code only. (PR #157059)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 5 06:13:42 PDT 2025
https://github.com/Sirraide commented:
I think it makes sense not to issue the warning considering that C doesn’t have a concept of NRVO from what I know. That said, I don’t think the current approach is right because it just prevents NRVO in C entirely; we still want to perform NRVO, we just don’t want to warn if we can’t.
What I think we should do instead is the same thing that GCC does, i.e. reject the flag in the driver if we’re compiling C.
https://github.com/llvm/llvm-project/pull/157059
More information about the cfe-commits
mailing list