| /llvm-project-15.0.7/clang-tools-extra/test/clang-tidy/checkers/bugprone/ |
| H A D | undelegated-constructor.cpp | 3 struct Ctor; 4 Ctor foo(); 6 struct Ctor { struct 7 Ctor(); 8 Ctor(int); 10 Ctor(Ctor *i) { in Ctor() argument 11 Ctor(); in Ctor() 13 Ctor(0); in Ctor() 21 Ctor::Ctor() { in Ctor() function in Ctor 22 Ctor(1); in Ctor() [all …]
|
| H A D | undelegated-constructor-cxx98.cpp | 6 struct Ctor; 7 Ctor foo(); 9 struct Ctor { struct 10 Ctor(); 11 Ctor(int); 13 Ctor(Ctor *i) { in Ctor() function 14 Ctor(); in Ctor() 15 Ctor(0); in Ctor() 16 Ctor(1, 2); in Ctor() 21 Ctor::Ctor() { in Ctor() function in Ctor [all …]
|
| H A D | unused-raii.cpp | 32 struct Ctor { struct 33 Ctor(int); 34 Ctor() { in Ctor() argument 35 Ctor(0); // TODO: warn here. in Ctor()
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/google/ |
| H A D | ExplicitConstructorCheck.cpp | 102 if (Ctor->isOutOfLine() || Ctor->getNumParams() == 0 || in check() 103 Ctor->getMinRequiredArguments() > 1) in check() 107 Ctor->getParamDecl(0)->getType().getNonReferenceType()); in check() 108 if (Ctor->isExplicit() && in check() 116 Ctor->getOuterLocStart(), Ctor->getEndLoc(), IsKwExplicit); in check() 118 if (Ctor->isMoveConstructor()) in check() 120 else if (Ctor->isCopyConstructor()) in check() 125 auto Diag = diag(Ctor->getLocation(), in check() 135 if (Ctor->isExplicit() || Ctor->isCopyOrMoveConstructor() || in check() 140 Ctor->getNumParams() == 1 && !Ctor->getParamDecl(0)->isParameterPack(); in check() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/modernize/ |
| H A D | PassByValueCheck.cpp | 41 for (const CXXConstructorDecl *Ctor : Node.ctors()) { in AST_MATCHER() local 42 if (Ctor->isMoveConstructor() && !Ctor->isDeleted()) in AST_MATCHER() 80 TraverseDecl(const_cast<CXXConstructorDecl *>(Ctor)); in paramReferredExactlyOnce() 131 static bool hasRValueOverload(const CXXConstructorDecl *Ctor, in hasRValueOverload() argument 138 const CXXRecordDecl *Record = Ctor->getParent(); in hasRValueOverload() 143 if (C == Ctor || C->isDeleted() || in hasRValueOverload() 144 C->getNumParams() != Ctor->getNumParams()) in hasRValueOverload() 180 collectParamDecls(const CXXConstructorDecl *Ctor, in collectParamDecls() argument 185 for (const FunctionDecl *Redecl : Ctor->redecls()) in collectParamDecls() 252 if (!paramReferredExactlyOnce(Ctor, ParamDecl)) in check() [all …]
|
| H A D | UseEqualsDefaultCheck.cpp | 61 const CXXConstructorDecl *Ctor) { in isCopyConstructorAndCanBeDefaulted() argument 63 if (Ctor->getMinRequiredArguments() != 1) in isCopyConstructorAndCanBeDefaulted() 66 const auto *Record = Ctor->getParent(); in isCopyConstructorAndCanBeDefaulted() 67 const auto *Param = Ctor->getParamDecl(0); in isCopyConstructorAndCanBeDefaulted() 89 *Ctor, *Context) in isCopyConstructorAndCanBeDefaulted() 111 *Ctor, *Context) in isCopyConstructorAndCanBeDefaulted() 117 return Ctor->getNumCtorInitializers() == in isCopyConstructorAndCanBeDefaulted() 278 if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(SpecialFunctionDecl)) { in check() local 279 if (Ctor->getNumParams() == 0) { in check() 282 if (!isCopyConstructorAndCanBeDefaulted(Result.Context, Ctor)) in check() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/docs/clang-tidy/checks/hicpp/ |
| H A D | undelegated-constructor.rst | 14 struct Ctor { 15 Ctor(); 16 Ctor(int); 17 Ctor(int, int); 18 Ctor(Ctor *i) { 19 // All Ctor() calls result in a temporary object 20 Ctor(); // did you intend to call a delegated constructor? 21 Ctor(0); // did you intend to call a delegated constructor? 22 Ctor(1, 2); // did you intend to call a delegated constructor?
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/bugprone/ |
| H A D | CopyConstructorInitCheck.cpp | 35 const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor"); in check() local 36 std::string ParamName = Ctor->getParamDecl(0)->getNameAsString(); in check() 44 for (const auto *Init : Ctor->inits()) { in check() 64 for (const auto *Ctor : BaseClass->ctors()) { in check() local 65 if (Ctor->isCopyConstructor() && in check() 66 (Ctor->getAccess() == AS_private || Ctor->isDeleted())) { in check() 83 Ctor->getLocation().isMacroID() || ShouldNotDoFixit) in check() 92 auto Diag = diag(Ctor->getLocation(), in check() 103 FixItLoc = Ctor->getBody()->getBeginLoc(); in check() 107 FixItLoc = (*Ctor->init_begin())->getSourceLocation(); in check()
|
| H A D | ForwardingReferenceOverloadCheck.cpp | 114 const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor"); in check() local 115 for (auto *Iter = Ctor->param_begin() + 1; Iter != Ctor->param_end(); in check() 122 for (const auto *OtherCtor : Ctor->getParent()->ctors()) { in check() 134 diag(Ctor->getLocation(), in check() 138 for (const auto *OtherCtor : Ctor->getParent()->ctors()) { in check()
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/cppcoreguidelines/ |
| H A D | ProTypeMemberInitCheck.cpp | 315 if (!Ctor->getBody()) in check() 319 if (Ctor->isExplicitlyDefaulted() && !Ctor->isDefaultConstructor()) in check() 321 checkMissingMemberInitializer(*Result.Context, *Ctor->getParent(), Ctor); in check() 322 checkMissingBaseClassInitializer(*Result.Context, *Ctor->getParent(), Ctor); in check() 433 if (Ctor) { in checkMissingMemberInitializer() 465 diag(Ctor ? Ctor->getBeginLoc() : ClassDecl.getLocation(), in checkMissingMemberInitializer() 475 if (Ctor && Ctor->getBeginLoc().isMacroID()) in checkMissingMemberInitializer() 505 } else if (Ctor) { in checkMissingMemberInitializer() 532 if (Ctor) { in checkMissingBaseClassInitializer() 546 diag(Ctor ? Ctor->getBeginLoc() : ClassDecl.getLocation(), in checkMissingBaseClassInitializer() [all …]
|
| H A D | PreferMemberInitializerCheck.cpp | 88 const CXXConstructorDecl *Ctor) { in isAssignmentToMemberOf() argument 104 if (isSafeAssignment(Field, Init, Ctor)) in isAssignmentToMemberOf() 122 if (isSafeAssignment(Field, Init, Ctor)) in isAssignmentToMemberOf() 152 const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructorDecl>("ctor"); in check() local 153 const auto *Body = cast<CompoundStmt>(Ctor->getBody()); in check() 155 const CXXRecordDecl *Class = Ctor->getParent(); in check() 179 std::tie(Field, InitValue) = isAssignmentToMemberOf(Class, S, Ctor); in check() 182 Ctor->isDefaultConstructor() && in check() 228 for (const CXXCtorInitializer *Init : Ctor->inits()) { in check() 267 Ctor->getTypeSourceInfo() in check()
|
| /llvm-project-15.0.7/clang/test/Parser/ |
| H A D | cxx-class.cpp | 107 class Ctor { // expected-note{{not complete until the closing '}'}} class 108 Ctor(f)(int); // ok 109 Ctor(g(int)); // ok 110 Ctor(x[5]); // expected-error{{incomplete type}} 112 Ctor(UnknownType *); // expected-error{{unknown type name 'UnknownType'}} 116 Ctor::Ctor (x) = { 0 }; // \ 119 Ctor::Ctor(UnknownType *) {} // \ in Ctor() function in ctor_error::Ctor 121 void Ctor::operator+(UnknownType*) {} // \ in operator +()
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Utils/ |
| H A D | ModuleUtils.cpp | 124 Function *Ctor = Function::createWithDefaultAttr( in createSanitizerCtor() local 127 Ctor->addFnAttr(Attribute::NoUnwind); in createSanitizerCtor() 131 appendToUsed(M, {Ctor}); in createSanitizerCtor() 132 return Ctor; in createSanitizerCtor() 144 Function *Ctor = createSanitizerCtor(M, CtorName); in createSanitizerCtorAndInitFunctions() local 153 return std::make_pair(Ctor, InitFunction); in createSanitizerCtorAndInitFunctions() 164 if (Function *Ctor = M.getFunction(CtorName)) in getOrCreateSanitizerCtorAndInitFunctions() local 167 if (Ctor->arg_empty() || in getOrCreateSanitizerCtorAndInitFunctions() 171 Function *Ctor; in getOrCreateSanitizerCtorAndInitFunctions() local 175 FunctionsCreatedCallback(Ctor, InitFunction); in getOrCreateSanitizerCtorAndInitFunctions() [all …]
|
| /llvm-project-15.0.7/clang/unittests/ASTMatchers/Dynamic/ |
| H A D | RegistryTest.cpp | 47 if (Ctor) in constructMatcher() 60 if (Ctor) in constructMatcher() 74 if (Ctor) in constructMatcher() 92 if (!Ctor) in getCompletions() 94 Context.push_back(std::make_pair(*Ctor, ArgNo1)); in getCompletions() 103 if (!Ctor) in getCompletions() 105 Context.push_back(std::make_pair(*Ctor, ArgNo1)); in getCompletions() 106 Ctor = lookupMatcherCtor(MatcherName2); in getCompletions() 107 if (!Ctor) in getCompletions() 531 auto Ctor = *lookupMatcherCtor("mapAnyOf"); in TEST_F() local [all …]
|
| /llvm-project-15.0.7/clang/test/CXX/class/class.union/ |
| H A D | p1.cpp | 16 class Ctor { class 17 …Ctor() { abort(); } // expected-note 2{{because type 'Ctor' has a user-provided default constructo… in Ctor() function in Ctor 41 Ctor ctor; // expected-error {{union member 'ctor' has a non-trivial default constructor}} 58 …Ctor ctor; // expected-note {{because field of type 'Ctor' has a user-provided default constructor… 82 …struct s3 : Ctor { // expected-note {{because base class of type 'Ctor' has a user-provided defaul… 128 Either<int,Ctor> ctor(0); // expected-note {{in instantiation of template}} in fred()
|
| /llvm-project-15.0.7/clang/unittests/Tooling/RecursiveASTVisitorTests/ |
| H A D | ImplicitCtor.cpp | 21 bool VisitCXXConstructorDecl(CXXConstructorDecl* Ctor) { in VisitCXXConstructorDecl() argument 22 if (Ctor->isImplicit()) { // Was not written in source code in VisitCXXConstructorDecl() 23 if (const CXXRecordDecl* Class = Ctor->getParent()) { in VisitCXXConstructorDecl() 24 Match(Class->getName(), Ctor->getLocation()); in VisitCXXConstructorDecl()
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/performance/ |
| H A D | MoveConstructorInitCheck.cpp | 59 for (const auto *Ctor : CopyCtor->getParent()->ctors()) { in check() local 60 if (Ctor->isMoveConstructor() && Ctor->getAccess() <= AS_protected && in check() 61 !Ctor->isDeleted()) { in check() 68 Candidate = Ctor; in check()
|
| /llvm-project-15.0.7/llvm/include/llvm/CodeGen/ |
| H A D | MachinePassRegistry.h | 53 PassCtorTy Ctor; // Pass creator. variable 57 : Name(N), Description(D), Ctor(C) {} in MachinePassRegistryNode() 64 PassCtorTy getCtor() const { return Ctor; } in getCtor() 91 PassCtorTy Ctor = nullptr; in setDefault() local 95 Ctor = R->getCtor(); in setDefault() 99 assert(Ctor && "Unregistered pass name"); in setDefault() 100 setDefault(Ctor); in setDefault()
|
| /llvm-project-15.0.7/clang/lib/ASTMatchers/Dynamic/ |
| H A D | Parser.cpp | 480 ScopedContextEntry SCE(this, Ctor); in parseMatcherBuilder() 554 S->buildMatcherCtor(Ctor, NameToken.Range, Args, Error); in parseMatcherBuilder() 633 if (!Ctor) { in parseMatcherExpressionImpl() 639 if (Ctor && *Ctor && S->isBuilderMatcher(*Ctor)) in parseMatcherExpressionImpl() 648 ScopedContextEntry SCE(this, Ctor.value_or(nullptr)); in parseMatcherExpressionImpl() 720 if (!Ctor) in parseMatcherExpressionImpl() 729 *Ctor, MatcherRange, BindID, Args, Error); in parseMatcherExpressionImpl() 837 MatcherCtor Ctor, SourceRange NameRange, StringRef BindID, in actOnMatcherExpression() argument 858 return Registry::isBuilderMatcher(Ctor); in isBuilderMatcher() 862 return Registry::nodeMatcherType(Ctor); in nodeMatcherType() [all …]
|
| H A D | Registry.cpp | 602 ASTNodeKind Registry::nodeMatcherType(MatcherCtor Ctor) { in nodeMatcherType() argument 603 return Ctor->nodeMatcherType(); in nodeMatcherType() 611 bool Registry::isBuilderMatcher(MatcherCtor Ctor) { in isBuilderMatcher() argument 612 return Ctor->isBuilderMatcher(); in isBuilderMatcher() 619 Ctor->buildMatcherCtor(NameRange, Args, Error).release()); in buildMatcherCtor() 664 MatcherCtor Ctor = CtxEntry.first; in getAcceptedCompletionTypes() local 669 Ctor->isConvertibleTo(Kind.getMatcherKind()) && in getAcceptedCompletionTypes() 670 (Ctor->isVariadic() || ArgNumber < Ctor->getNumArgs())) in getAcceptedCompletionTypes() 785 VariantMatcher Registry::constructMatcher(MatcherCtor Ctor, in constructMatcher() argument 789 return Ctor->create(NameRange, Args, Error); in constructMatcher() [all …]
|
| /llvm-project-15.0.7/clang/test/SemaCXX/ |
| H A D | deprecated.cpp | 90 struct Ctor { struct 91 Ctor(); 92 …Ctor(const Ctor&); // expected-warning {{definition of implicit copy assignment operator for 'Ctor… 94 Ctor b1, b2;
|
| /llvm-project-15.0.7/clang/include/clang/ASTMatchers/Dynamic/ |
| H A D | Parser.h | 88 virtual VariantMatcher actOnMatcherExpression(MatcherCtor Ctor, 144 VariantMatcher actOnMatcherExpression(MatcherCtor Ctor, 153 bool isBuilderMatcher(MatcherCtor Ctor) const override; 253 bool parseMatcherBuilder(MatcherCtor Ctor, const TokenInfo &NameToken, 257 llvm::Optional<MatcherCtor> Ctor,
|
| H A D | Registry.h | 88 static bool isBuilderMatcher(MatcherCtor Ctor); 138 static VariantMatcher constructMatcher(MatcherCtor Ctor, 149 static VariantMatcher constructBoundMatcher(MatcherCtor Ctor,
|
| /llvm-project-15.0.7/clang-tools-extra/clangd/refactor/tweaks/ |
| H A D | SpecialMembers.cpp | 31 } Ctor, Assign; in buildSpecialMemberDeclarations() local 40 Ctor.Copy = C; in buildSpecialMemberDeclarations() 42 Ctor.Move = C; in buildSpecialMemberDeclarations() 64 PrintMembers(Ctor, /*MemberPattern=*/"{0}({1})"); in buildSpecialMemberDeclarations()
|
| /llvm-project-15.0.7/clang-tools-extra/clang-tidy/cert/ |
| H A D | ProperlySeededRandomGeneratorCheck.cpp | 82 const auto *Ctor = Result.Nodes.getNodeAs<CXXConstructExpr>("ctor"); in check() local 83 if (Ctor) in check() 84 checkSeed(Result, Ctor); in check()
|