summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/fuchsia
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/fuchsia')
-rw-r--r--clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp16
-rw-r--r--clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp5
-rw-r--r--clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp4
-rw-r--r--clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp2
-rw-r--r--clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp2
6 files changed, 14 insertions, 17 deletions
diff --git a/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
index 493ce9a24bf..f6c64ce131d 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/DefaultArgumentsCheck.cpp
@@ -27,8 +27,7 @@ void DefaultArgumentsCheck::check(const MatchFinder::MatchResult &Result) {
Result.Nodes.getNodeAs<CXXDefaultArgExpr>("stmt")) {
diag(S->getUsedLocation(),
"calling a function that uses a default argument is disallowed");
- diag(S->getParam()->getLocStart(),
- "default parameter was declared here",
+ diag(S->getParam()->getBeginLoc(), "default parameter was declared here",
DiagnosticIDs::Note);
} else if (const ParmVarDecl *D =
Result.Nodes.getNodeAs<ParmVarDecl>("decl")) {
@@ -37,11 +36,11 @@ void DefaultArgumentsCheck::check(const MatchFinder::MatchResult &Result) {
if (DefaultArgRange.getEnd() != D->getLocEnd()) {
return;
} else if (DefaultArgRange.getBegin().isMacroID()) {
- diag(D->getLocStart(),
+ diag(D->getBeginLoc(),
"declaring a parameter with a default argument is disallowed");
} else {
- SourceLocation StartLocation = D->getName().empty() ?
- D->getLocStart() : D->getLocation();
+ SourceLocation StartLocation =
+ D->getName().empty() ? D->getBeginLoc() : D->getLocation();
SourceRange RemovalRange(Lexer::getLocForEndOfToken(
StartLocation, 0,
@@ -51,10 +50,9 @@ void DefaultArgumentsCheck::check(const MatchFinder::MatchResult &Result) {
DefaultArgRange.getEnd()
);
- diag(D->getLocStart(),
- "declaring a parameter with a default argument is disallowed")
- << D
- << FixItHint::CreateRemoval(RemovalRange);
+ diag(D->getBeginLoc(),
+ "declaring a parameter with a default argument is disallowed")
+ << D << FixItHint::CreateRemoval(RemovalRange);
}
}
}
diff --git a/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
index 35504c98278..a49c952f393 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
@@ -120,9 +120,8 @@ void MultipleInheritanceCheck::check(const MatchFinder::MatchResult &Result) {
}
if (NumConcrete > 1) {
- diag(D->getLocStart(),
- "inheriting mulitple classes that aren't "
- "pure virtual is discouraged");
+ diag(D->getBeginLoc(), "inheriting mulitple classes that aren't "
+ "pure virtual is discouraged");
}
}
}
diff --git a/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
index 847f7635dd6..8e6c74f322e 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/OverloadedOperatorCheck.cpp
@@ -34,8 +34,8 @@ void OverloadedOperatorCheck::registerMatchers(MatchFinder *Finder) {
void OverloadedOperatorCheck::check(const MatchFinder::MatchResult &Result) {
const auto *D = Result.Nodes.getNodeAs<FunctionDecl>("decl");
assert(D && "No FunctionDecl captured!");
-
- SourceLocation Loc = D->getLocStart();
+
+ SourceLocation Loc = D->getBeginLoc();
if (Loc.isValid())
diag(Loc, "overloading %0 is disallowed") << D;
}
diff --git a/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
index 16a534b1810..e33f90acb1a 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.cpp
@@ -51,7 +51,7 @@ void StaticallyConstructedObjectsCheck::registerMatchers(MatchFinder *Finder) {
void StaticallyConstructedObjectsCheck::check(
const MatchFinder::MatchResult &Result) {
if (const auto *D = Result.Nodes.getNodeAs<VarDecl>("decl"))
- diag(D->getLocStart(), "static objects are disallowed; if possible, use a "
+ diag(D->getBeginLoc(), "static objects are disallowed; if possible, use a "
"constexpr constructor instead");
}
diff --git a/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp
index 7af0c9c6020..4ffa3f79588 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.cpp
@@ -43,7 +43,7 @@ void TrailingReturnCheck::registerMatchers(MatchFinder *Finder) {
void TrailingReturnCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *D = Result.Nodes.getNodeAs<Decl>("decl"))
- diag(D->getLocStart(),
+ diag(D->getBeginLoc(),
"a trailing return type is disallowed for this type of declaration");
}
diff --git a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
index f3da2b6ef1d..82f44103407 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
@@ -35,7 +35,7 @@ void VirtualInheritanceCheck::registerMatchers(MatchFinder *Finder) {
void VirtualInheritanceCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *D = Result.Nodes.getNodeAs<CXXRecordDecl>("decl"))
- diag(D->getLocStart(), "direct virtual inheritance is disallowed");
+ diag(D->getBeginLoc(), "direct virtual inheritance is disallowed");
}
} // namespace fuchsia
OpenPOWER on IntegriCloud