Lines Matching refs:Dc
208 for (DeclContext *DC = S.CurContext;
209 DC && FoundTypeDecl == UnqualifiedTypeNameLookupResult::NotFound;
210 DC = DC->getParent()) {
213 RD = dyn_cast<CXXRecordDecl>(DC);
467 synthesizeCurrentNestedNameSpecifier(ASTContext &Context, DeclContext *DC) {
468 for (;; DC = DC->getLookupParent()) {
469 DC = DC->getPrimaryContext();
470 auto *ND = dyn_cast<NamespaceDecl>(DC);
473 else if (auto *RD = dyn_cast<CXXRecordDecl>(DC))
476 else if (isa<TranslationUnitDecl>(DC))
487 findRecordWithDependentBasesOfEnclosingMethod(const DeclContext *DC) {
488 for (; DC && DC->isDependentContext(); DC = DC->getLookupParent()) {
489 DC = DC->getPrimaryContext();
490 if (const auto *MD = dyn_cast<CXXMethodDecl>(DC))
624 } else if (DeclContext *DC = computeDeclContext(*SS, false)) {
630 << II << DC << DroppedSpecifier << SS->getRange());
673 else if (DeclContext *DC = computeDeclContext(*SS, false))
675 << II << DC << SS->getRange();
1077 DeclContext *Sema::getContainingDC(DeclContext *DC) {
1090 // lexically containing DC (which could be a nested class).
1091 if (isa<FunctionDecl>(DC) && !isLambdaCallOperator(DC)) {
1092 DC = DC->getLexicalParent();
1096 if (!isa<CXXRecordDecl>(DC))
1097 return DC;
1102 while (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC->getLexicalParent()))
1103 DC = RD;
1107 return DC;
1110 return DC->getLexicalParent();
1113 void Sema::PushDeclContext(Scope *S, DeclContext *DC) {
1114 assert(getContainingDC(DC) == CurContext &&
1116 CurContext = DC;
1117 S->setEntity(DC);
1130 // the containing DC of TD, because the new context will be some pre-existing
1148 void Sema::EnterDeclaratorContext(Scope *S, DeclContext *DC) {
1173 CurContext = DC;
1174 S->setEntity(DC);
1314 Scope *Sema::getScopeForDeclContext(Scope *S, DeclContext *DC) {
1315 DeclContext *TargetDC = DC->getPrimaryContext();
1399 const DeclContext *DC = D->getDeclContext();
1400 while (!DC->isTranslationUnit()) {
1401 if (const RecordDecl *RD = dyn_cast<RecordDecl>(DC)){
1405 DC = DC->getParent();
2659 const DeclContext *DC = Old->getDeclContext();
2660 if (DC->isRecord())
4422 Declarator Dc(DS, Declarator::MemberContext);
4423 TypeSourceInfo *TInfo = GetTypeForDeclarator(Dc, S);
4519 Declarator Dc(DS, Declarator::TypeNameContext);
4520 TypeSourceInfo *TInfo = GetTypeForDeclarator(Dc, S);
4806 bool Sema::DiagnoseClassNameShadow(DeclContext *DC,
4810 CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(DC);
4826 /// \param DC The declaration context to which the nested-name-specifier
4834 bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec &SS, DeclContext *DC,
4850 if (Cur->Equals(DC)) {
4864 if (!Cur->Encloses(DC)) {
4868 else if (isa<TranslationUnitDecl>(DC))
4879 << Name << cast<NamedDecl>(Cur) << cast<NamedDecl>(DC) << SS.getRange();
4939 DeclContext *DC = CurContext;
4948 DC = computeDeclContext(D.getCXXScopeSpec(), EnteringContext);
4949 if (!DC || isa<EnumDecl>(DC)) {
4960 bool IsDependentContext = DC->isDependentContext();
4963 RequireCompleteDeclContext(D.getCXXScopeSpec(), DC))
4967 if (isa<CXXRecordDecl>(DC) && !cast<CXXRecordDecl>(DC)->hasDefinition()) {
4970 << Name << DC << D.getCXXScopeSpec().getRange();
4974 if (diagnoseQualifiedDeclaration(D.getCXXScopeSpec(), DC,
4976 if (DC->isRecord())
4987 ContextRAII SavedContext(*this, DC);
4996 DC, NameInfo))
5039 LookupQualifiedName(Previous, DC);
5104 if (!DC->getRedeclContext()->isFileContext()) {
5120 New = ActOnTypedefDeclarator(S, D, DC, TInfo, Previous);
5122 New = ActOnFunctionDeclarator(S, D, DC, TInfo, Previous,
5126 New = ActOnVariableDeclarator(S, D, DC, TInfo, Previous, TemplateParamLists,
5309 Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
5317 DC = CurContext;
5348 NamedDecl *ND = ActOnTypedefNameDecl(S, DC, NewTD, Previous, Redeclaration);
5394 Sema::ActOnTypedefNameDecl(Scope *S, DeclContext *DC, TypedefNameDecl *NewTD,
5398 FilterLookupForScope(Previous, DC, S, /*ConsiderLinkage*/false,
5436 /// \param DC the context in which the new declaration is being
5442 isOutOfScopePreviousDeclaration(NamedDecl *PrevDecl, DeclContext *DC,
5457 DeclContext *OuterContext = DC->getRedeclContext();
5769 const DeclContext *DC = VD->getDeclContext()->getRedeclContext();
5770 if (DC->isFunctionOrMethod() || isa<OMPDeclareReductionDecl>(DC))
5772 if (DC->isFileContext())
5774 if (DC->isRecord())
5780 const DeclContext *DC = FD->getDeclContext()->getRedeclContext();
5781 if (DC->isFileContext() || DC->isFunctionOrMethod() ||
5782 isa<OMPDeclareReductionDecl>(DC))
5784 if (DC->isRecord())
5816 bool Sema::adjustContextForLocalExternDecl(DeclContext *&DC) {
5817 if (!DC->isFunctionOrMethod())
5823 if (DC->isDependentContext())
5833 while (!DC->isFileContext() && !isa<LinkageSpecDecl>(DC))
5834 DC = DC->getParent();
5849 DC,
5872 if (SC == SC_None && !DC->isRecord() &&
5877 DeclContext *OriginalDC = DC;
5879 adjustContextForLocalExternDecl(DC);
5932 if (!DC->isRecord() && S->getFnParent() == nullptr) {
5976 NewVD = VarDecl::Create(Context, DC, D.getLocStart(),
5988 if (DC->isRecord() && !CurContext->isRecord()) {
6016 if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC)) {
6099 NewVD = VarDecl::Create(Context, DC, D.getLocStart(),
6105 VarTemplateDecl::Create(Context, DC, D.getIdentifierLoc(), Name,
6214 !DC->isFunctionOrMethod()))
6446 (D.getCXXScopeSpec().isSet() && DC && DC->isRecord() &&
6447 DC->isDependentContext())
7061 bool Sema::AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD) {
7070 if (DC->lookupInBases(FOM, Paths)) {
7336 DeclContext *DC, QualType &R,
7356 NewFD = FunctionDecl::Create(SemaRef.Context, DC,
7372 if (!DC->isRecord() &&
7380 assert(DC->isRecord() &&
7384 return CXXConstructorDecl::Create(SemaRef.Context, cast<CXXRecordDecl>(DC),
7392 if (DC->isRecord()) {
7394 CXXRecordDecl *Record = cast<CXXRecordDecl>(DC);
7419 return FunctionDecl::Create(SemaRef.Context, DC,
7427 if (!DC->isRecord()) {
7435 return CXXConversionDecl::Create(SemaRef.Context, cast<CXXRecordDecl>(DC),
7440 } else if (DC->isRecord()) {
7446 Name.getAsIdentifierInfo() == cast<CXXRecordDecl>(DC)->getIdentifier()){
7455 cast<CXXRecordDecl>(DC),
7470 return FunctionDecl::Create(SemaRef.Context, DC,
7658 Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
7691 DeclContext *OriginalDC = DC;
7692 bool IsLocalExternDecl = adjustContextForLocalExternDecl(DC);
7694 FunctionDecl *NewFD = CreateNewFunctionDecl(*this, D, DC, R, TInfo, SC,
7771 if (DC->isDependentContext()) {
7772 ContextRAII SavedContext(*this, DC);
7777 FunctionTemplate = FunctionTemplateDecl::Create(Context, DC,
8049 if (isa<CXXMethodDecl>(NewFD) && DC == CurContext &&
8305 (NewFD->getType()->isDependentType() || DC->isDependentContext() ||
8385 if (NewFD->isOverloadedOperator() && !DC->isRecord() &&
8402 DC && DC->isRecord() &&
8403 DC->isDependentContext())
8505 if (!DC->isRecord() && NewFD->isExternallyVisible())
10622 const DeclContext *DC = VD->getDeclContext();
10625 if (DC->getRedeclContext()->isFileContext() && VD->isExternallyVisible())
10913 ParmVarDecl *Sema::BuildParmVarDeclForTypedef(DeclContext *DC,
10919 ParmVarDecl *Param = ParmVarDecl::Create(Context, DC, Loc, Loc, nullptr,
10968 ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc,
10995 ParmVarDecl *New = ParmVarDecl::Create(Context, DC, StartLoc, NameLoc, Name,
12177 DeclContext *DC = ND->getDeclContext()->getRedeclContext();
12178 for (; !DC->isTranslationUnit(); DC = DC->getParent()) {
12181 NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(DC);
12196 if (DC->isTranslationUnit())
12228 static DeclContext *getTagInjectionContext(DeclContext *DC) {
12229 while (!DC->isFileContext() && !DC->isFunctionOrMethod())
12230 DC = DC->getParent();
12231 return DC;
12358 DeclContext *DC = CurContext;
12378 DC = computeDeclContext(SS, false);
12379 if (!DC) {
12384 DC = computeDeclContext(SS, true);
12385 if (!DC) {
12392 if (RequireCompleteDeclContext(SS, DC))
12395 SearchDC = DC;
12397 LookupQualifiedName(Previous, DC);
12417 << Kind << Name << DC << SS.getRange();
12471 DeclContext *DC = ND->getDeclContext()->getRedeclContext();
12472 if (DC->isFileContext() &&
12513 if (getLangOpts().CPlusPlus && Name && DC && StdNamespace &&
12514 DC->Equals(getStdNamespace()) && Name->isStr("bad_alloc")) {
12812 // of reference, make sure we build the redeclaration in the same DC
12985 diagnoseQualifiedDeclaration(SS, DC, OrigName, Loc))
13080 DeclContext *DC = New->getDeclContext()->getRedeclContext();
13081 DC->makeDeclVisibleInContext(New);
13083 if (Scope *EnclosingScope = getScopeForDeclContext(S, DC))
13208 void Sema::ActOnObjCTemporaryExitContainerContext(DeclContext *DC) {
13209 assert(DC == CurContext && "Mismatch of container contexts");
13210 OriginalLexicalContext = DC;
13214 void Sema::ActOnObjCReenterContainerContext(DeclContext *DC) {
13215 ActOnObjCContainerStartDefinition(cast<Decl>(DC));
13860 ObjCContainerDecl *DC = cast<ObjCContainerDecl>(EnclosingDecl);
13861 switch (DC->getKind()) {
13864 Context.ResetObjCLayout(cast<ObjCCategoryDecl>(DC)->getClassInterface());
13868 ResetObjCLayout(cast<ObjCImplementationDecl>(DC)->getClassInterface());
15024 SourceLocation ImportLoc, DeclContext *DC,
15028 if (auto *LSD = dyn_cast<LinkageSpecDecl>(DC)) {
15037 DC = LSD->getParent();
15040 while (isa<LinkageSpecDecl>(DC))
15041 DC = DC->getParent();
15043 if (!isa<TranslationUnitDecl>(DC)) {
15047 << M->getFullModuleName() << DC;
15048 S.Diag(cast<Decl>(DC)->getLocStart(),
15049 diag::note_module_import_not_at_top_level) << DC;