Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp

Issue 2307643002: Account for the fact that some type traits have static methods. (Closed)
Patch Set: Taking car of type traits with enum value. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5d6d0b964b28fdfb6090b6b41928cc3875d52810..600adeb807171fb69775d72155cf35aa883edac9 100644
--- a/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
+++ b/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp
@@ -59,6 +59,10 @@ AST_MATCHER(clang::FunctionDecl, isOverloadedOperator) {
return Node.isOverloadedOperator();
}
+AST_MATCHER(clang::CXXMethodDecl, isInstanceMethod) {
+ return Node.isInstance();
+}
+
AST_MATCHER_P(clang::FunctionTemplateDecl,
templatedDecl,
clang::ast_matchers::internal::Matcher<clang::FunctionDecl>,
@@ -642,8 +646,10 @@ int main(int argc, const char* argv[]) {
auto field_decl_matcher = id("decl", fieldDecl(in_blink_namespace));
auto is_type_trait_value =
varDecl(hasName("value"), hasStaticStorageDuration(), isPublic(),
- hasType(isConstQualified()), hasType(booleanType()),
- unless(hasAncestor(recordDecl(has(functionDecl())))));
+ hasType(isConstQualified()), hasType(type(anyOf(
+ booleanType(), enumType()))),
+ unless(hasAncestor(recordDecl(
+ has(cxxMethodDecl(isUserProvided(), isInstanceMethod()))))));
auto var_decl_matcher =
id("decl", varDecl(in_blink_namespace, unless(is_type_trait_value)));
auto enum_member_decl_matcher =
« no previous file with comments | « no previous file | tools/clang/rewrite_to_chrome_style/tests/fields-expected.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698