aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaChecking.cpp3
-rw-r--r--test/SemaCXX/warn-unused-comparison.cpp24
2 files changed, 26 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 71a7ebcd1c..181d40ba01 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -3472,6 +3472,9 @@ void AnalyzeImplicitConversions(Sema &S, Expr *OrigE, SourceLocation CC) {
QualType T = OrigE->getType();
Expr *E = OrigE->IgnoreParenImpCasts();
+ if (E->isTypeDependent() || E->isValueDependent())
+ return;
+
// For conditional operators, we analyze the arguments as if they
// were being fed directly into the output.
if (isa<ConditionalOperator>(E)) {
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;
+}