make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83940 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/unused-expr.c b/test/Sema/unused-expr.c
index 8b5d156..f8e7c91 100644
--- a/test/Sema/unused-expr.c
+++ b/test/Sema/unused-expr.c
@@ -25,7 +25,7 @@
__real__ VC;
// We know this can't change errno because of -fno-math-errno.
- sqrt(A); // expected-warning {{expression result unused}}
+ sqrt(A); // expected-warning {{ignoring return value of function declared with const attribute}}
}
extern void t1();
@@ -73,4 +73,8 @@
for (;;b == 1) {} // expected-warning{{expression result unused}}
}
-
+// rdar://7186119
+int t5f(void) __attribute__((warn_unused_result));
+void t5() {
+ t5f(); // expected-warning {{ignoring return value of function declared with warn_unused_result}}
+}