Index: clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp =================================================================== --- clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp +++ clang-tools-extra/trunk/clang-tidy/misc/RedundantExpressionCheck.cpp @@ -291,7 +291,7 @@ } AST_MATCHER(Expr, isIntegerConstantExpr) { - if (Node.isInstantiationDependent()) + if (Node.isInstantiationDependent() || Node.isValueDependent()) return false; return Node.isIntegerConstantExpr(Finder->getASTContext()); } Index: clang-tools-extra/trunk/test/clang-tidy/misc-redundant-expression.cpp =================================================================== --- clang-tools-extra/trunk/test/clang-tidy/misc-redundant-expression.cpp +++ clang-tools-extra/trunk/test/clang-tidy/misc-redundant-expression.cpp @@ -725,3 +725,15 @@ #undef FLAG1 #undef FLAG2 #undef FLAG3 + +namespace no_crash { +struct Foo {}; +bool operator<(const Foo&, const Foo&); +template +struct Bar { + static const Foo &GetFoo(); + static bool Test(const T & maybe_foo, const Foo& foo) { + return foo < GetFoo() && foo < maybe_foo; + } +}; +}