]> granicus.if.org Git - clang/commitdiff
PR7724: Don't try to evaluate value-dependent expressions.
authorEli Friedman <eli.friedman@gmail.com>
Tue, 27 Jul 2010 19:14:53 +0000 (19:14 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 27 Jul 2010 19:14:53 +0000 (19:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109532 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExpr.cpp
test/SemaTemplate/dependent-expr.cpp

index 2816c4a6139b85ced8a17799bcde66b63c7d38f5..4183ea3394d8c4d03fa2bc8b1d32d1e6c5e18211 100644 (file)
@@ -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
index 9fa757107bdb05350667ac8996c17941787c4535..e25afce77a6b080a5d314d28e591926777000b2e 100644 (file)
@@ -40,3 +40,8 @@ namespace PR7198 {
     }
   };
 }
+
+namespace PR7724 {
+  template<typename OT> int myMethod()
+  { return 2 && sizeof(OT); }
+}