brintos

brintos / llvm-project-archived public Read only

0
0
Text · 426 B · b375179 Raw
18 lines · cpp
1// RUN: %clang_cc1 -std=c++1z -verify %s2 3namespace std_example {4  struct [[nodiscard]] error_info{5    // ...6  };7 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();13  }14 15  error_info &foo();16  void f() { foo(); } // no warning17}18