llvm/clang-tools-extra/unittests/clang-tidy/AddConstTest.cpp

#include "../clang-tidy/utils/FixItHintUtils.h"
#include "ClangTidyDiagnosticConsumer.h"
#include "ClangTidyTest.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Tooling/Tooling.h"
#include "gtest/gtest.h"
#include <optional>

namespace clang {
namespace tidy {

namespace {
usingnamespaceclang::ast_matchers;
usingnamespaceutils::fixit;

template <QualifierTarget CT, QualifierPolicy CP>
class ConstTransform : public ClangTidyCheck {};
} // namespace

namespace test {
PointeeLTransform;
PointeeRTransform;

ValueLTransform;
ValueRTransform;

// ----------------------------------------------------------------------------
// Test Value-like types. Everything with indirection is done later.
// ----------------------------------------------------------------------------

TEST(Values, Builtin) {}
TEST(Values, TypedefBuiltin) {}
TEST(Values, TypedefBuiltinPointer) {}
TEST(Values, UsingBuiltin) {}
TEST(Values, UsingBuiltinPointer) {}
TEST(Values, AutoValue) {}
TEST(Values, AutoPointer) {}
TEST(Values, AutoReference) {}
TEST(Values, DeclTypeValue) {}
TEST(Values, DeclTypePointer) {}
TEST(Values, DeclTypeReference) {}
TEST(Values, Parens) {}

// ----------------------------------------------------------------------------
// Test builtin-arrays
// ----------------------------------------------------------------------------

TEST(Arrays, Builtin) {}
TEST(Arrays, BuiltinParens) {}
TEST(Arrays, Pointers) {}
TEST(Arrays, PointerPointers) {}
TEST(Arrays, PointersParens) {}

// ----------------------------------------------------------------------------
// Test reference types. This does not include pointers and arrays.
// ----------------------------------------------------------------------------

TEST(Reference, LValueBuiltin) {}
TEST(Reference, RValueBuiltin) {}
TEST(Reference, LValueToPointer) {}
TEST(Reference, LValueParens) {}
TEST(Reference, ToArray) {}
TEST(Reference, Auto) {}

// ----------------------------------------------------------------------------
// Test pointers types.
// ----------------------------------------------------------------------------

TEST(Pointers, SingleBuiltin) {}
TEST(Pointers, MultiBuiltin) {}
TEST(Pointers, ToArray) {}
TEST(Pointers, Parens) {}
TEST(Pointers, Auto) {}
TEST(Pointers, AutoParens) {}
TEST(Pointers, FunctionPointer) {}
TEST(Pointers, MemberFunctionPointer) {}
TEST(Pointers, MemberDataPointer) {}

// ----------------------------------------------------------------------------
// Test TagTypes (struct, class, unions, enums)
// ----------------------------------------------------------------------------

TEST(TagTypes, Struct) {}
TEST(TagTypes, Class) {}
TEST(TagTypes, Enum) {}
TEST(TagTypes, Union) {}

// ----------------------------------------------------------------------------
// Test Macro expansions.
// ----------------------------------------------------------------------------

TEST(Macro, AllInMacro) {}
TEST(Macro, MacroParameter) {}
TEST(Macro, MacroTypeValue) {}
TEST(Macro, MacroTypePointer) {}
TEST(Macro, MacroTypeReference) {}
// This failed in LLVM.
TEST(Macro, Variable) {}
TEST(Macro, RangeLoop) {}

// ----------------------------------------------------------------------------
// Test template code.
// ----------------------------------------------------------------------------

TEST(Template, TemplateVariable) {}
TEST(Template, FunctionValue) {}
TEST(Template, FunctionPointer) {}
TEST(Template, FunctionReference) {}
TEST(Template, MultiInstantiationsFunction) {}

TEST(Template, StructValue) {}
TEST(Template, StructPointer) {}
TEST(Template, StructReference) {}
TEST(Template, DependentReturnFunction) {}
TEST(Template, DependentReturnPointerFunction) {}
TEST(Template, DependentReturnReferenceFunction) {}
TEST(Template, VectorLikeType) {}
TEST(Template, SpecializedTemplate) {}

// -----------------------------------------------------------------------------
// ObjC Pointers
// -----------------------------------------------------------------------------

TEST(ObjC, SimplePointers) {}
TEST(ObjC, ClassPointer) {}
TEST(ObjC, InterfacePointer) {}

} // namespace test
} // namespace tidy
} // namespace clang