Aaron Ballman | 78ecb87 | 2014-10-16 20:13:28 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wunused-value %s |
2 | // expected-no-diagnostics | ||||
3 | |||||
4 | void f() __attribute__((const)); | ||||
5 | |||||
6 | namespace PR18571 { | ||||
7 | // Unevaluated contexts should not trigger unused result warnings. | ||||
8 | template <typename T> | ||||
9 | auto foo(T) -> decltype(f(), bool()) { // Should not warn. | ||||
10 | return true; | ||||
11 | } | ||||
12 | |||||
13 | void g() { | ||||
14 | foo(1); | ||||
15 | } | ||||
16 | } |