You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
libcxx_old/test/libcxx/diagnostics/nodiscard.pass.cpp

21 lines
597 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 _LIBCPP_NODISCARD_EXT is not defined to [[nodiscard]] unless
// explicitly enabled by _LIBCPP_ENABLE_NODISCARD
#include <__config>
_LIBCPP_NODISCARD_EXT int foo() { return 42; }
int main() {
foo(); // OK.
}