Skip to content

Commit 98f64f0

Browse files
committed
Merge from 'master' to 'sycl-web' (#183)
CONFLICT (content): Merge conflict in clang/test/Driver/clang-offload-wrapper.c
2 parents 1644cc6 + fca49fe commit 98f64f0

File tree

700 files changed

+12832
-4963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

700 files changed

+12832
-4963
lines changed

clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class ClangTidyDiagnosticRenderer : public DiagnosticRenderer {
6262
}
6363
assert(Error.Message.Message.empty() && "Overwriting a diagnostic message");
6464
Error.Message = TidyMessage;
65+
for (const CharSourceRange &SourceRange : Ranges) {
66+
Error.Ranges.emplace_back(Loc.getManager(), SourceRange);
67+
}
6568
}
6669

6770
void emitDiagnosticLoc(FullSourceLoc Loc, PresumedLoc PLoc,

clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ namespace abseil {
1717
using namespace clang::ast_matchers;
1818

1919
void DurationDivisionCheck::registerMatchers(MatchFinder *finder) {
20-
if (!getLangOpts().CPlusPlus)
21-
return;
22-
2320
const auto DurationExpr =
2421
expr(hasType(cxxRecordDecl(hasName("::absl::Duration"))));
2522
finder->addMatcher(

clang-tools-extra/clang-tidy/abseil/DurationDivisionCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ namespace abseil {
2323
class DurationDivisionCheck : public ClangTidyCheck {
2424
public:
2525
using ClangTidyCheck::ClangTidyCheck;
26+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
27+
return LangOpts.CPlusPlus;
28+
}
2629
void registerMatchers(ast_matchers::MatchFinder *finder) override;
2730
void check(const ast_matchers::MatchFinder::MatchResult &result) override;
2831
};

clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ llvm::Optional<std::string> makeCharacterLiteral(const StringLiteral *Literal,
5757
} // anonymous namespace
5858

5959
void FasterStrsplitDelimiterCheck::registerMatchers(MatchFinder *Finder) {
60-
if (!getLangOpts().CPlusPlus)
61-
return;
62-
6360
// Binds to one character string literals.
6461
const auto SingleChar =
6562
expr(ignoringParenCasts(stringLiteral(lengthIsOne()).bind("Literal")));

clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class FasterStrsplitDelimiterCheck : public ClangTidyCheck {
2424
public:
2525
FasterStrsplitDelimiterCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus;
29+
}
2730
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2831
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2932
};

clang-tools-extra/clang-tidy/abseil/NoInternalDependenciesCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ namespace tidy {
1818
namespace abseil {
1919

2020
void NoInternalDependenciesCheck::registerMatchers(MatchFinder *Finder) {
21-
if (!getLangOpts().CPlusPlus)
22-
return;
23-
2421
// TODO: refactor matcher to be configurable or just match on any internal
2522
// access from outside the enclosing namespace.
2623

clang-tools-extra/clang-tidy/abseil/NoInternalDependenciesCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class NoInternalDependenciesCheck : public ClangTidyCheck {
2424
public:
2525
NoInternalDependenciesCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus;
29+
}
2730
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2831
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2932
};

clang-tools-extra/clang-tidy/abseil/NoNamespaceCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ namespace tidy {
1818
namespace abseil {
1919

2020
void NoNamespaceCheck::registerMatchers(MatchFinder *Finder) {
21-
if (!getLangOpts().CPlusPlus)
22-
return;
23-
2421
Finder->addMatcher(
2522
namespaceDecl(hasName("::absl"), unless(isInAbseilFile()))
2623
.bind("abslNamespace"),

clang-tools-extra/clang-tidy/abseil/NoNamespaceCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class NoNamespaceCheck : public ClangTidyCheck {
2424
public:
2525
NoNamespaceCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus;
29+
}
2730
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2831
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2932
};

clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ namespace abseil {
2525
// argument.
2626

2727
void RedundantStrcatCallsCheck::registerMatchers(MatchFinder* Finder) {
28-
if (!getLangOpts().CPlusPlus)
29-
return;
3028
const auto CallToStrcat =
3129
callExpr(callee(functionDecl(hasName("::absl::StrCat"))));
3230
const auto CallToStrappend =

clang-tools-extra/clang-tidy/abseil/RedundantStrcatCallsCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class RedundantStrcatCallsCheck : public ClangTidyCheck {
2727
public:
2828
RedundantStrcatCallsCheck(StringRef Name, ClangTidyContext *Context)
2929
: ClangTidyCheck(Name, Context) {}
30+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
31+
return LangOpts.CPlusPlus;
32+
}
3033
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3134
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3235
};

clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ AST_MATCHER_P(Stmt, IgnoringTemporaries, ast_matchers::internal::Matcher<Stmt>,
4242
// str.append(StrCat(...))
4343

4444
void StrCatAppendCheck::registerMatchers(MatchFinder *Finder) {
45-
if (!getLangOpts().CPlusPlus)
46-
return;
4745
const auto StrCat = functionDecl(hasName("::absl::StrCat"));
4846
// The arguments of absl::StrCat are implicitly converted to AlphaNum. This
4947
// matches to the arguments because of that behavior.

clang-tools-extra/clang-tidy/abseil/StrCatAppendCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class StrCatAppendCheck : public ClangTidyCheck {
2424
public:
2525
StrCatAppendCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus;
29+
}
2730
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2831
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2932
};

clang-tools-extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ namespace tidy {
1818
namespace abseil {
1919

2020
void UpgradeDurationConversionsCheck::registerMatchers(MatchFinder *Finder) {
21-
if (!getLangOpts().CPlusPlus)
22-
return;
23-
2421
// For the arithmetic calls, we match only the uses of the templated operators
2522
// where the template parameter is not a built-in type. This means the
2623
// instantiation makes use of an available user defined conversion to

clang-tools-extra/clang-tidy/abseil/UpgradeDurationConversionsCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class UpgradeDurationConversionsCheck : public ClangTidyCheck {
2525
public:
2626
UpgradeDurationConversionsCheck(StringRef Name, ClangTidyContext *Context)
2727
: ClangTidyCheck(Name, Context) {}
28+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
29+
return LangOpts.CPlusPlus;
30+
}
2831
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2932
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3033

clang-tools-extra/clang-tidy/boost/UseToStringCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ AST_MATCHER(Type, isStrictlyInteger) {
2222
} // namespace
2323

2424
void UseToStringCheck::registerMatchers(MatchFinder *Finder) {
25-
if (!getLangOpts().CPlusPlus)
26-
return;
27-
2825
Finder->addMatcher(
2926
callExpr(
3027
hasDeclaration(functionDecl(

clang-tools-extra/clang-tidy/boost/UseToStringCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class UseToStringCheck : public ClangTidyCheck {
2525
public:
2626
UseToStringCheck(StringRef Name, ClangTidyContext *Context)
2727
: ClangTidyCheck(Name, Context) {}
28+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
29+
return LangOpts.CPlusPlus;
30+
}
2831
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2932
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3033
};

clang-tools-extra/clang-tidy/bugprone/CopyConstructorInitCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ namespace tidy {
1818
namespace bugprone {
1919

2020
void CopyConstructorInitCheck::registerMatchers(MatchFinder *Finder) {
21-
if (!getLangOpts().CPlusPlus)
22-
return;
23-
2421
// In the future this might be extended to move constructors?
2522
Finder->addMatcher(
2623
cxxConstructorDecl(

clang-tools-extra/clang-tidy/bugprone/CopyConstructorInitCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class CopyConstructorInitCheck : public ClangTidyCheck {
2424
public:
2525
CopyConstructorInitCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus;
29+
}
2730
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2831
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2932
};

clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ void DynamicStaticInitializersCheck::storeOptions(
4444
}
4545

4646
void DynamicStaticInitializersCheck::registerMatchers(MatchFinder *Finder) {
47-
if (!getLangOpts().CPlusPlus || getLangOpts().ThreadsafeStatics)
48-
return;
4947
Finder->addMatcher(
5048
varDecl(hasGlobalStorage(), unless(hasConstantDeclaration())).bind("var"),
5149
this);

clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ namespace bugprone {
2727
class DynamicStaticInitializersCheck : public ClangTidyCheck {
2828
public:
2929
DynamicStaticInitializersCheck(StringRef Name, ClangTidyContext *Context);
30+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
31+
return LangOpts.CPlusPlus && !LangOpts.ThreadsafeStatics;
32+
}
3033
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
3134
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3235
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;

clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ void ExceptionEscapeCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
5252
}
5353

5454
void ExceptionEscapeCheck::registerMatchers(MatchFinder *Finder) {
55-
if (!getLangOpts().CPlusPlus || !getLangOpts().CXXExceptions)
56-
return;
57-
5855
Finder->addMatcher(
5956
functionDecl(anyOf(isNoThrow(), cxxDestructorDecl(),
6057
cxxConstructorDecl(isMoveConstructor()),

clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ namespace bugprone {
2727
class ExceptionEscapeCheck : public ClangTidyCheck {
2828
public:
2929
ExceptionEscapeCheck(StringRef Name, ClangTidyContext *Context);
30+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
31+
return LangOpts.CPlusPlus && LangOpts.CXXExceptions;
32+
}
3033
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
3134
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3235
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;

clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ AST_MATCHER_P(TemplateTypeParmDecl, hasDefaultArgument,
6060
} // namespace
6161

6262
void ForwardingReferenceOverloadCheck::registerMatchers(MatchFinder *Finder) {
63-
// Forwarding references require C++11 or later.
64-
if (!getLangOpts().CPlusPlus11)
65-
return;
66-
6763
auto ForwardingRefParm =
6864
parmVarDecl(
6965
hasType(qualType(rValueReferenceType(),

clang-tools-extra/clang-tidy/bugprone/ForwardingReferenceOverloadCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class ForwardingReferenceOverloadCheck : public ClangTidyCheck {
3030
public:
3131
ForwardingReferenceOverloadCheck(StringRef Name, ClangTidyContext *Context)
3232
: ClangTidyCheck(Name, Context) {}
33+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
34+
return LangOpts.CPlusPlus11;
35+
}
3336
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3437
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3538
};

clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ namespace tidy {
1818
namespace bugprone {
1919

2020
void InaccurateEraseCheck::registerMatchers(MatchFinder *Finder) {
21-
// Only register the matchers for C++; the functionality currently does not
22-
// provide any benefit to other languages, despite being benign.
23-
if (!getLangOpts().CPlusPlus)
24-
return;
25-
2621
const auto EndCall =
2722
callExpr(
2823
callee(functionDecl(hasAnyName("remove", "remove_if", "unique"))),

clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class InaccurateEraseCheck : public ClangTidyCheck {
2626
public:
2727
InaccurateEraseCheck(StringRef Name, ClangTidyContext *Context)
2828
: ClangTidyCheck(Name, Context) {}
29+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
30+
return LangOpts.CPlusPlus;
31+
}
2932
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3033
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
3134
};

clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ static void replaceMoveWithForward(const UnresolvedLookupExpr *Callee,
6767
}
6868

6969
void MoveForwardingReferenceCheck::registerMatchers(MatchFinder *Finder) {
70-
if (!getLangOpts().CPlusPlus11)
71-
return;
72-
7370
// Matches a ParmVarDecl for a forwarding reference, i.e. a non-const rvalue
7471
// reference of a function template parameter type.
7572
auto ForwardingReferenceParmMatcher =

clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class MoveForwardingReferenceCheck : public ClangTidyCheck {
3737
public:
3838
MoveForwardingReferenceCheck(StringRef Name, ClangTidyContext *Context)
3939
: ClangTidyCheck(Name, Context) {}
40+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
41+
return LangOpts.CPlusPlus11;
42+
}
4043
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
4144
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
4245
};

clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ void StringConstructorCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
3535
}
3636

3737
void StringConstructorCheck::registerMatchers(MatchFinder *Finder) {
38-
if (!getLangOpts().CPlusPlus)
39-
return;
40-
4138
const auto ZeroExpr = expr(ignoringParenImpCasts(integerLiteral(equals(0))));
4239
const auto CharExpr = expr(ignoringParenImpCasts(characterLiteral()));
4340
const auto NegativeExpr = expr(ignoringParenImpCasts(

clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ namespace bugprone {
2222
class StringConstructorCheck : public ClangTidyCheck {
2323
public:
2424
StringConstructorCheck(StringRef Name, ClangTidyContext *Context);
25+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
26+
return LangOpts.CPlusPlus;
27+
}
2528
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
2629
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2730
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;

clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ namespace tidy {
1818
namespace bugprone {
1919

2020
void StringIntegerAssignmentCheck::registerMatchers(MatchFinder *Finder) {
21-
if (!getLangOpts().CPlusPlus)
22-
return;
2321
Finder->addMatcher(
2422
cxxOperatorCallExpr(
2523
anyOf(hasOverloadedOperatorName("="),

clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ class StringIntegerAssignmentCheck : public ClangTidyCheck {
2323
public:
2424
StringIntegerAssignmentCheck(StringRef Name, ClangTidyContext *Context)
2525
: ClangTidyCheck(Name, Context) {}
26+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
27+
return LangOpts.CPlusPlus;
28+
}
2629
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2730
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2831
};

clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ namespace tidy {
1717
namespace bugprone {
1818

1919
void ThrowKeywordMissingCheck::registerMatchers(MatchFinder *Finder) {
20-
if (!getLangOpts().CPlusPlus)
21-
return;
22-
2320
auto CtorInitializerList =
2421
cxxConstructorDecl(hasAnyConstructorInitializer(anything()));
2522

clang-tools-extra/clang-tidy/bugprone/ThrowKeywordMissingCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class ThrowKeywordMissingCheck : public ClangTidyCheck {
2424
public:
2525
ThrowKeywordMissingCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus;
29+
}
2730
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2831
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2932
};

clang-tools-extra/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ void UndelegatedConstructorCheck::registerMatchers(MatchFinder *Finder) {
5353
// depending on the type's destructor and the number of arguments on the
5454
// constructor call, this is handled by ignoringTemporaryExpr. Ignore template
5555
// instantiations to reduce the number of duplicated warnings.
56-
//
57-
// Only register the matchers for C++11; the functionality currently does not
58-
// provide any benefit to other languages, despite being benign.
59-
if (!getLangOpts().CPlusPlus11)
60-
return;
6156

6257
Finder->addMatcher(
6358
compoundStmt(

clang-tools-extra/clang-tidy/bugprone/UndelegatedConstructorCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class UndelegatedConstructorCheck : public ClangTidyCheck {
2424
public:
2525
UndelegatedConstructorCheck(StringRef Name, ClangTidyContext *Context)
2626
: ClangTidyCheck(Name, Context) {}
27+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
28+
return LangOpts.CPlusPlus11;
29+
}
2730
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2831
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2932
};

clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ void UnhandledSelfAssignmentCheck::storeOptions(
2929
}
3030

3131
void UnhandledSelfAssignmentCheck::registerMatchers(MatchFinder *Finder) {
32-
if (!getLangOpts().CPlusPlus)
33-
return;
34-
3532
// We don't care about deleted, default or implicit operator implementations.
3633
const auto IsUserDefined = cxxMethodDecl(
3734
isDefinition(), unless(anyOf(isDeleted(), isImplicit(), isDefaulted())));

clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class UnhandledSelfAssignmentCheck : public ClangTidyCheck {
2525
public:
2626
UnhandledSelfAssignmentCheck(StringRef Name, ClangTidyContext *Context);
2727

28+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
29+
return LangOpts.CPlusPlus;
30+
}
2831
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
2932
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
3033
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;

0 commit comments

Comments
 (0)