summaryrefslogtreecommitdiff
path: root/test/SemaCXX/warn-unused-comparison.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-10 17:38:18 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-10 17:38:18 +0000
commitf8b6e1591b5c5085cf4dec8df657e32a68053b12 (patch)
treef1e0d75929840f6427ad13945b93b40e1bdccd5a /test/SemaCXX/warn-unused-comparison.cpp
parentd61db33331c264d6361283602b248a7423040597 (diff)
downloadclang-f8b6e1591b5c5085cf4dec8df657e32a68053b12.tar.gz
Don't analyze comparisons in type- or value-dependent
subexpressions. Fixes PR10291. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/warn-unused-comparison.cpp')
-rw-r--r--test/SemaCXX/warn-unused-comparison.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/SemaCXX/warn-unused-comparison.cpp b/test/SemaCXX/warn-unused-comparison.cpp
index c193462e15..0153f213ba 100644
--- a/test/SemaCXX/warn-unused-comparison.cpp
+++ b/test/SemaCXX/warn-unused-comparison.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wno-unused -Wunused-comparison %s
+// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify -Wno-unused -Wunused-comparison %s
struct A {
bool operator==(const A&);
@@ -70,3 +70,25 @@ void test() {
EQ(x, 5);
#undef EQ
}
+
+namespace PR10291 {
+ template<typename T>
+ class X
+ {
+ public:
+
+ X() : i(0) { }
+
+ void foo()
+ {
+ throw
+ i == 0u ?
+ 5 : 6;
+ }
+
+ private:
+ int i;
+ };
+
+ X<int> x;
+}