Index: lib/Sema/SemaStmt.cpp
===================================================================
--- lib/Sema/SemaStmt.cpp	(revision 219791)
+++ lib/Sema/SemaStmt.cpp	(working copy)
@@ -185,6 +185,12 @@
   const Expr *E = dyn_cast_or_null<Expr>(S);
   if (!E)
     return;
+
+  // If we are in an unevaluated expression context, then there can be no unused
+  // results because the results aren't expected to be used in the first place.
+  if (isUnevaluatedContext())
+    return;
+
   SourceLocation ExprLoc = E->IgnoreParens()->getExprLoc();
   // In most cases, we don't want to warn if the expression is written in a
   // macro body, or if the macro comes from a system header. If the offending
Index: test/SemaCXX/warn-unused-result.cpp
===================================================================
--- test/SemaCXX/warn-unused-result.cpp	(revision 219791)
+++ test/SemaCXX/warn-unused-result.cpp	(working copy)
@@ -94,3 +94,16 @@
 };
 
 }
+
+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);
+}
+}
+
Index: test/SemaCXX/warn-unused-value-cxx11.cpp
===================================================================
--- test/SemaCXX/warn-unused-value-cxx11.cpp	(revision 0)
+++ test/SemaCXX/warn-unused-value-cxx11.cpp	(working copy)
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wunused-value %s
+
+namespace PR18571 {
+void f() __attribute__((const));
+
+// 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);
+}
+}
