libcxx-libcxxabi-x86_64-linux-ubuntu-asan complains about a leak here. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@342814 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
914 B
C++
28 lines
914 B
C++
// -*- C++ -*-
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Test that entities declared [[nodiscard]] as at extension by libc++, are
|
|
// only actually declared such when _LIBCPP_ENABLE_NODISCARD is specified.
|
|
|
|
// 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.
|
|
|
|
#include <memory>
|
|
|
|
#include "test_macros.h"
|
|
|
|
int main() {
|
|
{
|
|
const auto p = std::get_temporary_buffer<int>(1);
|
|
std::return_temporary_buffer(p.first);
|
|
}
|
|
}
|