summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/warn-unused-value-cxx11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/warn-unused-value-cxx11.cpp')
-rw-r--r--clang/test/SemaCXX/warn-unused-value-cxx11.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/warn-unused-value-cxx11.cpp b/clang/test/SemaCXX/warn-unused-value-cxx11.cpp
new file mode 100644
index 00000000000..115ddf3e02d
--- /dev/null
+++ b/clang/test/SemaCXX/warn-unused-value-cxx11.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wunused-value %s
+// expected-no-diagnostics
+
+void f() __attribute__((const));
+
+namespace PR18571 {
+// Unevaluated contexts should not trigger unused result warnings.
+template <typename T>
+auto foo(T) -> decltype(f(), bool()) { // Should not warn.
+ return true;
+}
+
+void g() {
+ foo(1);
+}
+}
OpenPOWER on IntegriCloud