summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-08-17 09:34:37 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-08-17 09:34:37 +0000
commite2669397f1cfd2b444bef9c6ab875367e0a63d75 (patch)
treec5dc4c6f084eec67a2d9008d11a720c9989eb6d6 /clang/test/SemaTemplate
parent29027b9352c418d93e42dd029a77d6c41a7db552 (diff)
downloadbcm5719-llvm-e2669397f1cfd2b444bef9c6ab875367e0a63d75.tar.gz
bcm5719-llvm-e2669397f1cfd2b444bef9c6ab875367e0a63d75.zip
Treating the unused equality comparisons as something other than part of
-Wunused was a mistake. It resulted in duplicate warnings and lots of other hacks. Instead, this should be a special sub-category to -Wunused-value, much like -Wunused-result is. Moved to -Wunused-comparison, moved the implementation to piggy back on the -Wunused-value implementation instead of rolling its own, different mechanism for catching all of the "interesting" statements. I like the unused-value mechanism for this better, but its currently missing several top-level statements. For now, I've FIXME-ed out those test cases. I'll enhance the generic infrastructure to catch these statements in a subsequent patch. This patch also removes the cast-to-void fixit hint. This hint isn't available on any of the other -Wunused-value diagnostics, and if we want it to be, we should add it generically rather than in one specific case. llvm-svn: 137822
Diffstat (limited to 'clang/test/SemaTemplate')
-rw-r--r--clang/test/SemaTemplate/resolve-single-template-id.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/test/SemaTemplate/resolve-single-template-id.cpp b/clang/test/SemaTemplate/resolve-single-template-id.cpp
index ef0a7630767..0c4656a8bc1 100644
--- a/clang/test/SemaTemplate/resolve-single-template-id.cpp
+++ b/clang/test/SemaTemplate/resolve-single-template-id.cpp
@@ -44,9 +44,10 @@ int main()
!oneT<int>; // expected-warning {{expression result unused}}
+oneT<int>; // expected-warning {{expression result unused}}
-oneT<int>; //expected-error {{invalid argument type}}
- oneT<int> == 0; // expected-warning {{expression result unused}}
- 0 == oneT<int>; // expected-warning {{expression result unused}}
- 0 != oneT<int>; // expected-warning {{expression result unused}}
+ oneT<int> == 0; // expected-warning {{equality comparison result unused}} \
+ // expected-note {{use '=' to turn this equality comparison into an assignment}}
+ 0 == oneT<int>; // expected-warning {{equality comparison result unused}}
+ 0 != oneT<int>; // expected-warning {{inequality comparison result unused}}
(false ? one : oneT<int>); // expected-warning {{expression result unused}}
void (*p1)(int); p1 = oneT<int>;
@@ -67,7 +68,8 @@ int main()
two < two; //expected-error {{cannot resolve overloaded function 'two' from context}}
twoT<int> < twoT<int>; //expected-error {{cannot resolve overloaded function 'twoT' from context}}
- oneT<int> == 0; // expected-warning {{expression result unused}}
+ oneT<int> == 0; // expected-warning {{equality comparison result unused}} \
+ // expected-note {{use '=' to turn this equality comparison into an assignment}}
}
OpenPOWER on IntegriCloud