Index: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
diff --git a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
index 9123f5527b8b6411a510dda0371e251cb9248078..c261f252a9e55248ac6b7e61ef39b972682b55e4 100644 |
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp |
@@ -150,6 +150,15 @@ bool IsProbablyConst(const clang::VarDecl& decl, |
if (!initializer) |
return false; |
+ // If the expression is dependent on a template input, then we are not |
+ // sure if it can be compile-time generated as calling isEvaluatable() is |
+ // not valid on |initializer|. |
+ // TODO(crbug.com/581218): We could probably look at each compiled |
+ // instantiation of the template and see if they are all compile-time |
+ // isEvaluable(). |
+ if (initializer->isInstantiationDependent()) |
+ return false; |
+ |
// If the expression can be evaluated at compile time, then it should have a |
// kFoo style name. Otherwise, not. |
return initializer->isEvaluatable(context); |