[lldb][Windows] Fix build with MSVC compiler broken by (#108072)
[llvm-project.git] / clang / test / CXX / dcl.dcl / dcl.attr / dcl.attr.nodiscard / p3.cpp
blobb37517921b1ca4ce315c183355a45ebf058a4fda
1 // RUN: %clang_cc1 -std=c++1z -verify %s
3 namespace std_example {
4 struct [[nodiscard]] error_info{
5 // ...
6 };
8 error_info enable_missile_safety_mode();
9 void launch_missiles();
10 void test_missiles() {
11 enable_missile_safety_mode(); // expected-warning {{ignoring return value of type 'error_info' declared with 'nodiscard'}}
12 launch_missiles();
15 error_info &foo();
16 void f() { foo(); } // no warning