summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
index 339bc3c2569..a9405471d29 100644
--- a/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/UseAutoCheck.cpp
@@ -218,20 +218,21 @@ StatementMatcher makeIteratorDeclMatcher() {
}
StatementMatcher makeDeclWithNewMatcher() {
- return declStmt(has(varDecl()),
- unless(has(varDecl(anyOf(
- unless(hasInitializer(ignoringParenImpCasts(newExpr()))),
- // FIXME: TypeLoc information is not reliable where CV
- // qualifiers are concerned so these types can't be
- // handled for now.
- hasType(pointerType(
- pointee(hasCanonicalType(hasLocalQualifiers())))),
-
- // FIXME: Handle function pointers. For now we ignore them
- // because the replacement replaces the entire type
- // specifier source range which includes the identifier.
- hasType(pointsTo(
- pointsTo(parenType(innerType(functionType()))))))))))
+ return declStmt(
+ has(varDecl()),
+ unless(has(varDecl(anyOf(
+ unless(hasInitializer(ignoringParenImpCasts(cxxNewExpr()))),
+ // FIXME: TypeLoc information is not reliable where CV
+ // qualifiers are concerned so these types can't be
+ // handled for now.
+ hasType(pointerType(
+ pointee(hasCanonicalType(hasLocalQualifiers())))),
+
+ // FIXME: Handle function pointers. For now we ignore them
+ // because the replacement replaces the entire type
+ // specifier source range which includes the identifier.
+ hasType(pointsTo(
+ pointsTo(parenType(innerType(functionType()))))))))))
.bind(DeclWithNewId);
}
OpenPOWER on IntegriCloud