[libcxx] r342819 - [libcxx] Readjust nodiscard_extensions.pass.cpp test - just disable for ASAN

Roman Lebedev lebedev.ri at gmail.com
Sat Sep 22 13:07:02 PDT 2018


Author: lebedevri
Date: Sat Sep 22 13:07:02 2018
New Revision: 342819

URL: http://llvm.org/viewvc/llvm-project?rev=342819&view=rev
Log:
[libcxx] Readjust nodiscard_extensions.pass.cpp test - just disable for ASAN

In rL342814, i have committed a blind fix to unbreak the asan buildbot,
but as it was later discussed, the leak is intentional,
so we can not fix the failure that way.

So this reverts the leak 'fix',
and simply disables the test in the presence of ASAN.

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

Modified: libcxx/trunk/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp?rev=342819&r1=342818&r2=342819&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/diagnostics/nodiscard_extensions.pass.cpp Sat Sep 22 13:07:02 2018
@@ -11,6 +11,9 @@
 // Test that entities declared [[nodiscard]] as at extension by libc++, are
 // only actually declared such when _LIBCPP_ENABLE_NODISCARD is specified.
 
+// This test intentionally leaks memory, so it is unsupported under ASAN.
+// UNSUPPORTED: asan
+
 // All entities to which libc++ applies [[nodiscard]] as an extension should
 // be tested here and in nodiscard_extensions.fail.cpp. They should also
 // be listed in `UsingLibcxx.rst` in the documentation for the extension.
@@ -21,7 +24,6 @@
 
 int main() {
   {
-    const auto p = std::get_temporary_buffer<int>(1);
-    std::return_temporary_buffer(p.first);
+    std::get_temporary_buffer<int>(1); // intentional memory leak.
   }
 }




More information about the libcxx-commits mailing list