llvm/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp

//===--- ProTypeMemberInitCheck.cpp - clang-tidy---------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "ProTypeMemberInitCheck.h"
#include "../utils/LexerUtils.h"
#include "../utils/Matchers.h"
#include "../utils/TypeTraits.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/SmallPtrSet.h"

usingnamespaceclang::ast_matchers;
usingnamespaceclang::tidy::matchers;
SmallPtrSet;
SmallPtrSetImpl;

namespace clang::tidy::cppcoreguidelines {

namespace {

AST_MATCHER(CXXRecordDecl, hasDefaultConstructor) {}

// Iterate over all the fields in a record type, both direct and indirect (e.g.
// if the record contains an anonymous struct).
template <typename T, typename Func>
void forEachField(const RecordDecl &Record, const T &Fields, const Func &Fn) {}

template <typename T, typename Func>
void forEachFieldWithFilter(const RecordDecl &Record, const T &Fields,
                            bool &AnyMemberHasInitPerUnion, const Func &Fn) {}

void removeFieldInitialized(const FieldDecl *M,
                            SmallPtrSetImpl<const FieldDecl *> &FieldDecls) {}

void removeFieldsInitializedInBody(
    const Stmt &Stmt, ASTContext &Context,
    SmallPtrSetImpl<const FieldDecl *> &FieldDecls) {}

StringRef getName(const FieldDecl *Field) {}

StringRef getName(const RecordDecl *Record) {}

// Creates comma separated list of decls requiring initialization in order of
// declaration.
template <typename R, typename T>
std::string
toCommaSeparatedString(const R &OrderedDecls,
                       const SmallPtrSetImpl<const T *> &DeclsToInit) {}

SourceLocation getLocationForEndOfToken(const ASTContext &Context,
                                        SourceLocation Location) {}

// There are 3 kinds of insertion placements:
enum class InitializerPlacement {};

// An InitializerInsertion contains a list of fields and/or base classes to
// insert into the initializer list of a constructor. We use this to ensure
// proper absolute ordering according to the class declaration relative to the
// (perhaps improper) ordering in the existing initializer list, if any.
struct InitializerInsertion {};

// Convenience utility to get a RecordDecl from a QualType.
const RecordDecl *getCanonicalRecordDecl(const QualType &Type) {}

template <typename R, typename T>
SmallVector<InitializerInsertion, 16>
computeInsertions(const CXXConstructorDecl::init_const_range &Inits,
                  const R &OrderedDecls,
                  const SmallPtrSetImpl<const T *> &DeclsToInit) {}

// Gets the list of bases and members that could possibly be initialized, in
// order as they appear in the class declaration.
void getInitializationsInOrder(const CXXRecordDecl &ClassDecl,
                               SmallVectorImpl<const NamedDecl *> &Decls) {}

template <typename T>
void fixInitializerList(const ASTContext &Context, DiagnosticBuilder &Diag,
                        const CXXConstructorDecl *Ctor,
                        const SmallPtrSetImpl<const T *> &DeclsToInit) {}

} // anonymous namespace

ProTypeMemberInitCheck::ProTypeMemberInitCheck(StringRef Name,
                                               ClangTidyContext *Context)
    :{}

void ProTypeMemberInitCheck::registerMatchers(MatchFinder *Finder) {}

void ProTypeMemberInitCheck::check(const MatchFinder::MatchResult &Result) {}

void ProTypeMemberInitCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {}

// FIXME: Copied from clang/lib/Sema/SemaDeclCXX.cpp.
static bool isIncompleteOrZeroLengthArrayType(ASTContext &Context, QualType T) {}

static bool isEmpty(ASTContext &Context, const QualType &Type) {}

static const char *getInitializer(QualType QT, bool UseAssignment) {}

void ProTypeMemberInitCheck::checkMissingMemberInitializer(
    ASTContext &Context, const CXXRecordDecl &ClassDecl,
    const CXXConstructorDecl *Ctor) {}

void ProTypeMemberInitCheck::checkMissingBaseClassInitializer(
    const ASTContext &Context, const CXXRecordDecl &ClassDecl,
    const CXXConstructorDecl *Ctor) {}

void ProTypeMemberInitCheck::checkUninitializedTrivialType(
    const ASTContext &Context, const VarDecl *Var) {}

} // namespace clang::tidy::cppcoreguidelines