[clang] 80e2c58 - [clang] Remove redundant member initialization (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 9 00:20:20 PST 2022
Author: Kazu Hirata
Date: 2022-01-09T00:19:51-08:00
New Revision: 80e2c587498a7b2bf14dde47a33a058da6e88a9a
URL: https://github.com/llvm/llvm-project/commit/80e2c587498a7b2bf14dde47a33a058da6e88a9a
DIFF: https://github.com/llvm/llvm-project/commit/80e2c587498a7b2bf14dde47a33a058da6e88a9a.diff
LOG: [clang] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
Added:
Modified:
clang/include/clang/AST/ASTConcept.h
clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
clang/include/clang/Basic/Diagnostic.h
clang/include/clang/Basic/PartialDiagnostic.h
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/ParsedAttr.h
clang/include/clang/Sema/ParsedTemplate.h
clang/lib/AST/MicrosoftCXXABI.cpp
clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/utils/TableGen/MveEmitter.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h
index c9930844add80..c8a1dc83b8aae 100644
--- a/clang/include/clang/AST/ASTConcept.h
+++ b/clang/include/clang/AST/ASTConcept.h
@@ -132,8 +132,7 @@ class ConceptReference {
NamedConcept(NamedConcept), ArgsAsWritten(ArgsAsWritten) {}
ConceptReference()
- : TemplateKWLoc(), FoundDecl(nullptr), NamedConcept(nullptr),
- ArgsAsWritten(nullptr) {}
+ : FoundDecl(nullptr), NamedConcept(nullptr), ArgsAsWritten(nullptr) {}
const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const {
return NestedNameSpec;
diff --git a/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h b/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
index 25eb38e6435e0..3f6f364d65052 100644
--- a/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
+++ b/clang/include/clang/ASTMatchers/Dynamic/Diagnostics.h
@@ -40,7 +40,7 @@ struct SourceRange {
/// A VariantValue instance annotated with its parser context.
struct ParserValue {
- ParserValue() : Range() {}
+ ParserValue() {}
StringRef Text;
SourceRange Range;
VariantValue Value;
diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h
index e5577e74fa639..6a80823d12422 100644
--- a/clang/include/clang/Basic/Diagnostic.h
+++ b/clang/include/clang/Basic/Diagnostic.h
@@ -1326,7 +1326,7 @@ class DiagnosticBuilder : public StreamingDiagnostic {
public:
/// Copy constructor. When copied, this "takes" the diagnostic info from the
/// input and neuters it.
- DiagnosticBuilder(const DiagnosticBuilder &D) : StreamingDiagnostic() {
+ DiagnosticBuilder(const DiagnosticBuilder &D) {
DiagObj = D.DiagObj;
DiagStorage = D.DiagStorage;
IsActive = D.IsActive;
diff --git a/clang/include/clang/Basic/PartialDiagnostic.h b/clang/include/clang/Basic/PartialDiagnostic.h
index 9fb70bff7fee1..217441979869b 100644
--- a/clang/include/clang/Basic/PartialDiagnostic.h
+++ b/clang/include/clang/Basic/PartialDiagnostic.h
@@ -49,8 +49,7 @@ class PartialDiagnostic : public StreamingDiagnostic {
PartialDiagnostic(unsigned DiagID, DiagStorageAllocator &Allocator_)
: StreamingDiagnostic(Allocator_), DiagID(DiagID) {}
- PartialDiagnostic(const PartialDiagnostic &Other)
- : StreamingDiagnostic(), DiagID(Other.DiagID) {
+ PartialDiagnostic(const PartialDiagnostic &Other) : DiagID(Other.DiagID) {
Allocator = Other.Allocator;
if (Other.DiagStorage) {
DiagStorage = getStorage();
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index fd2221f030861..d266a0b37265c 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -1475,8 +1475,7 @@ class Parser : public CodeCompletionHandler {
/// information that has been parsed prior to parsing declaration
/// specifiers.
struct ParsedTemplateInfo {
- ParsedTemplateInfo()
- : Kind(NonTemplate), TemplateParams(nullptr), TemplateLoc() { }
+ ParsedTemplateInfo() : Kind(NonTemplate), TemplateParams(nullptr) {}
ParsedTemplateInfo(TemplateParameterLists *TemplateParams,
bool isSpecialization,
diff --git a/clang/include/clang/Sema/ParsedAttr.h b/clang/include/clang/Sema/ParsedAttr.h
index 657cf9253c77c..4fa6f09d3321f 100644
--- a/clang/include/clang/Sema/ParsedAttr.h
+++ b/clang/include/clang/Sema/ParsedAttr.h
@@ -1080,7 +1080,7 @@ struct ParsedAttributesWithRange : ParsedAttributes {
SourceRange Range;
};
struct ParsedAttributesViewWithRange : ParsedAttributesView {
- ParsedAttributesViewWithRange() : ParsedAttributesView() {}
+ ParsedAttributesViewWithRange() {}
void clearListOnly() {
ParsedAttributesView::clearListOnly();
Range = SourceRange();
diff --git a/clang/include/clang/Sema/ParsedTemplate.h b/clang/include/clang/Sema/ParsedTemplate.h
index f0245b93c7eb2..72f91d0aa41a0 100644
--- a/clang/include/clang/Sema/ParsedTemplate.h
+++ b/clang/include/clang/Sema/ParsedTemplate.h
@@ -64,7 +64,7 @@ namespace clang {
SourceLocation TemplateLoc)
: Kind(ParsedTemplateArgument::Template),
Arg(Template.getAsOpaquePtr()),
- SS(SS), Loc(TemplateLoc), EllipsisLoc() { }
+ SS(SS), Loc(TemplateLoc) { }
/// Determine whether the given template argument is invalid.
bool isInvalid() const { return Arg == nullptr; }
diff --git a/clang/lib/AST/MicrosoftCXXABI.cpp b/clang/lib/AST/MicrosoftCXXABI.cpp
index 53d7e0b042ff1..b7dc0e62e66af 100644
--- a/clang/lib/AST/MicrosoftCXXABI.cpp
+++ b/clang/lib/AST/MicrosoftCXXABI.cpp
@@ -36,8 +36,8 @@ class MicrosoftNumberingContext : public MangleNumberingContext {
public:
MicrosoftNumberingContext()
- : MangleNumberingContext(), LambdaManglingNumber(0),
- StaticLocalNumber(0), StaticThreadlocalNumber(0) {}
+ : LambdaManglingNumber(0), StaticLocalNumber(0),
+ StaticThreadlocalNumber(0) {}
unsigned getManglingNumber(const CXXMethodDecl *CallOperator) override {
return ++LambdaManglingNumber;
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 60f37c17c3f18..683e82ec3f187 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -187,7 +187,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
CodeSegStack(nullptr), FpPragmaStack(FPOptionsOverride()),
CurInitSeg(nullptr), VisContext(nullptr),
PragmaAttributeCurrentTargetDecl(nullptr),
- IsBuildingRecoveryCallExpr(false), Cleanup{}, LateTemplateParser(nullptr),
+ IsBuildingRecoveryCallExpr(false), LateTemplateParser(nullptr),
LateTemplateParserCleanup(nullptr), OpaqueParser(nullptr), IdResolver(pp),
StdExperimentalNamespaceCache(nullptr), StdInitializerList(nullptr),
StdCoroutineTraitsCache(nullptr), CXXTypeInfoDecl(nullptr),
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 008c781478a06..454b2647cf347 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -6614,7 +6614,7 @@ QualType Sema::FindCompositePointerType(SourceLocation Loc,
const Type *ClassOrBound;
Step(Kind K, const Type *ClassOrBound = nullptr)
- : K(K), Quals(), ClassOrBound(ClassOrBound) {}
+ : K(K), ClassOrBound(ClassOrBound) {}
QualType rebuild(ASTContext &Ctx, QualType T) const {
T = Ctx.getQualifiedType(T, Quals);
switch (K) {
diff --git a/clang/utils/TableGen/MveEmitter.cpp b/clang/utils/TableGen/MveEmitter.cpp
index 1a2532fbf53fc..cc830c1d5416c 100644
--- a/clang/utils/TableGen/MveEmitter.cpp
+++ b/clang/utils/TableGen/MveEmitter.cpp
@@ -1489,8 +1489,7 @@ class string_holder {
class raw_self_contained_string_ostream : private string_holder,
public raw_string_ostream {
public:
- raw_self_contained_string_ostream()
- : string_holder(), raw_string_ostream(S) {}
+ raw_self_contained_string_ostream() : raw_string_ostream(S) {}
};
const char LLVMLicenseHeader[] =
More information about the cfe-commits
mailing list