From: Richard Smith Date: Mon, 18 Apr 2022 02:39:55 +0000 (-0700) Subject: Specify -fno-builtin when testing to make sure that certain stdlib X-Git-Tag: upstream/15.0.7~10172 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c105bcbf98f343fc3687ccfa675378666434eef5;p=platform%2Fupstream%2Fllvm.git Specify -fno-builtin when testing to make sure that certain stdlib functions are not treated as [[nodiscard]]. The compiler might choose to treat them as [[nodiscard]] without the involvement of libc++ if we allow it to recognize them as builtins. --- diff --git a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp index 15bd2f590aa1..ea8c989a9984 100644 --- a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp +++ b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp @@ -16,6 +16,10 @@ // be tested here and in nodiscard_extensions.fail.cpp. They should also // be listed in `UsingLibcxx.rst` in the documentation for the extension. +// Disable any builtin recognition of std::* in the compiler, that might also +// trigger -Wunused-value warnings. +// ADDITIONAL_COMPILE_FLAGS: -fno-builtin + #include #include // bit_cast #include // to_integer