[libcxx-commits] [libcxx] c105bcb - Specify -fno-builtin when testing to make sure that certain stdlib

Richard Smith via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 17 19:41:49 PDT 2022


Author: Richard Smith
Date: 2022-04-17T19:41:34-07:00
New Revision: c105bcbf98f343fc3687ccfa675378666434eef5

URL: https://github.com/llvm/llvm-project/commit/c105bcbf98f343fc3687ccfa675378666434eef5
DIFF: https://github.com/llvm/llvm-project/commit/c105bcbf98f343fc3687ccfa675378666434eef5.diff

LOG: 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.

Added: 
    

Modified: 
    libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp
index 15bd2f590aa10..ea8c989a99840 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 <algorithm>
 #include <bit> // bit_cast
 #include <cstddef> // to_integer


        


More information about the libcxx-commits mailing list