aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaExpr.cpp2
-rw-r--r--test/SemaTemplate/dependent-expr.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 2816c4a613..4183ea3394 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5815,7 +5815,7 @@ inline QualType Sema::CheckLogicalOperands( // C99 6.5.[13,14]
// bitwise one. We do this when the LHS is a non-bool integer and the RHS
// is a constant.
if (lex->getType()->isIntegerType() && !lex->getType()->isBooleanType() &&
- rex->getType()->isIntegerType() &&
+ rex->getType()->isIntegerType() && !rex->isValueDependent() &&
// Don't warn in macros.
!Loc.isMacroID()) {
// If the RHS can be constant folded, and if it constant folds to something
diff --git a/test/SemaTemplate/dependent-expr.cpp b/test/SemaTemplate/dependent-expr.cpp
index 9fa757107b..e25afce77a 100644
--- a/test/SemaTemplate/dependent-expr.cpp
+++ b/test/SemaTemplate/dependent-expr.cpp
@@ -40,3 +40,8 @@ namespace PR7198 {
}
};
}
+
+namespace PR7724 {
+ template<typename OT> int myMethod()
+ { return 2 && sizeof(OT); }
+}