diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2019-01-04 16:58:14 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2019-01-04 16:58:14 +0000 |
| commit | fb6deeb984d6d1dd16938c41a662bdafc969b745 (patch) | |
| tree | b22b6b1562daaf1890eadb5f41f633f578bc0f0b /clang/test/CodeCompletion | |
| parent | c2054144eec0d6ee9826a3ba7439bab219872c84 (diff) | |
| download | bcm5719-llvm-fb6deeb984d6d1dd16938c41a662bdafc969b745.tar.gz bcm5719-llvm-fb6deeb984d6d1dd16938c41a662bdafc969b745.zip | |
Refactor the way we handle diagnosing unused expression results.
Rather than sprinkle calls to DiagnoseUnusedExprResult() around in places where we want diagnostics, we now diagnose unused expression statements and full expressions in a more generic way when acting on the final expression statement. This results in more appropriate diagnostics for [[nodiscard]] where we were previously lacking them, such as when the body of a for loop is not a compound statement.
This patch fixes PR39837.
llvm-svn: 350404
Diffstat (limited to 'clang/test/CodeCompletion')
| -rw-r--r-- | clang/test/CodeCompletion/pragma-macro-token-caching.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CodeCompletion/pragma-macro-token-caching.c b/clang/test/CodeCompletion/pragma-macro-token-caching.c index 432706e85ce..59b6621b56a 100644 --- a/clang/test/CodeCompletion/pragma-macro-token-caching.c +++ b/clang/test/CodeCompletion/pragma-macro-token-caching.c @@ -12,7 +12,7 @@ void completeParam(int param) { void completeParamPragmaError(int param) { Outer(__extension__({ _Pragma(2) })); // expected-error {{_Pragma takes a parenthesized string literal}} - param; + param; // expected-warning {{expression result unused}} } // RUN: %clang_cc1 -fsyntax-only -verify -code-completion-at=%s:16:1 %s | FileCheck %s |

