summaryrefslogtreecommitdiff
path: root/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp')
-rw-r--r--test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp b/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
index c7d080d84..56df9248d 100644
--- a/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
+++ b/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
@@ -1,10 +1,9 @@
// -*- 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.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
@@ -24,8 +23,10 @@
_LIBCPP_NODISCARD_EXT int foo() { return 42; }
_LIBCPP_NODISCARD_AFTER_CXX17 int bar() { return 42; }
-int main() {
+int main(int, char**) {
bar(); // expected-error-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
foo(); // OK.
(void)bar(); // OK.
+
+ return 0;
}