[cfe-commits] r109532 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaTemplate/dependent-expr.cpp
Eli Friedman
eli.friedman at gmail.com
Tue Jul 27 12:14:53 PDT 2010
Author: efriedma
Date: Tue Jul 27 14:14:53 2010
New Revision: 109532
URL: http://llvm.org/viewvc/llvm-project?rev=109532&view=rev
Log:
PR7724: Don't try to evaluate value-dependent expressions.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaTemplate/dependent-expr.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=109532&r1=109531&r2=109532&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Tue Jul 27 14:14:53 2010
@@ -5815,7 +5815,7 @@
// 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
Modified: cfe/trunk/test/SemaTemplate/dependent-expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/dependent-expr.cpp?rev=109532&r1=109531&r2=109532&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/dependent-expr.cpp (original)
+++ cfe/trunk/test/SemaTemplate/dependent-expr.cpp Tue Jul 27 14:14:53 2010
@@ -40,3 +40,8 @@
}
};
}
+
+namespace PR7724 {
+ template<typename OT> int myMethod()
+ { return 2 && sizeof(OT); }
+}
More information about the cfe-commits
mailing list