summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/warn-unused-result.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/warn-unused-result.cpp')
-rw-r--r--test/SemaCXX/warn-unused-result.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-unused-result.cpp b/test/SemaCXX/warn-unused-result.cpp
index b0bf61f..581af09 100644
--- a/test/SemaCXX/warn-unused-result.cpp
+++ b/test/SemaCXX/warn-unused-result.cpp
@@ -78,3 +78,19 @@ void lazy() {
DoYetAnotherThing();
}
}
+
+namespace PR17587 {
+struct [[clang::warn_unused_result]] Status;
+
+struct Foo {
+ Status Bar();
+};
+
+struct Status {};
+
+void Bar() {
+ Foo f;
+ f.Bar(); // expected-warning {{ignoring return value}}
+};
+
+}
OpenPOWER on IntegriCloud