Lines Matching defs:DC
200 for (DeclContext *DC = S.CurContext;
201 DC && FoundTypeDecl == UnqualifiedTypeNameLookupResult::NotFound;
202 DC = DC->getParent()) {
205 RD = dyn_cast<CXXRecordDecl>(DC);
459 synthesizeCurrentNestedNameSpecifier(ASTContext &Context, DeclContext *DC) {
460 for (;; DC = DC->getLookupParent()) {
461 DC = DC->getPrimaryContext();
462 auto *ND = dyn_cast<NamespaceDecl>(DC);
465 else if (auto *RD = dyn_cast<CXXRecordDecl>(DC))
468 else if (isa<TranslationUnitDecl>(DC))
580 } else if (DeclContext *DC = computeDeclContext(*SS, false)) {
586 << II << DC << DroppedSpecifier << SS->getRange());
629 else if (DeclContext *DC = computeDeclContext(*SS, false))
631 << II << DC << SS->getRange();
1034 DeclContext *Sema::getContainingDC(DeclContext *DC) {
1047 // lexically containing DC (which could be a nested class).
1048 if (isa<FunctionDecl>(DC) && !isLambdaCallOperator(DC)) {
1049 DC = DC->getLexicalParent();
1053 if (!isa<CXXRecordDecl>(DC))
1054 return DC;
1059 while (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC->getLexicalParent()))
1060 DC = RD;
1064 return DC;
1067 return DC->getLexicalParent();
1070 void Sema::PushDeclContext(Scope *S, DeclContext *DC) {
1071 assert(getContainingDC(DC) == CurContext &&
1073 CurContext = DC;
1074 S->setEntity(DC);
1087 // the containing DC of TD, because the new context will be some pre-existing
1105 void Sema::EnterDeclaratorContext(Scope *S, DeclContext *DC) {
1130 CurContext = DC;
1131 S->setEntity(DC);
1274 Scope *Sema::getScopeForDeclContext(Scope *S, DeclContext *DC) {
1275 DeclContext *TargetDC = DC->getPrimaryContext();
1359 const DeclContext *DC = D->getDeclContext();
1360 while (!DC->isTranslationUnit()) {
1361 if (const RecordDecl *RD = dyn_cast<RecordDecl>(DC)){
1365 DC = DC->getParent();
2585 const DeclContext *DC = Old->getDeclContext();
2586 if (DC->isRecord())
4290 Declarator Dc(DS, Declarator::MemberContext);
4291 TypeSourceInfo *TInfo = GetTypeForDeclarator(Dc, S);
4388 Declarator Dc(DS, Declarator::TypeNameContext);
4389 TypeSourceInfo *TInfo = GetTypeForDeclarator(Dc, S);
4675 bool Sema::DiagnoseClassNameShadow(DeclContext *DC,
4679 if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(DC))
4693 /// \param DC The declaration context to which the nested-name-specifier
4701 bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec &SS, DeclContext *DC,
4717 if (Cur->Equals(DC)) {
4731 if (!Cur->Encloses(DC)) {
4735 else if (isa<TranslationUnitDecl>(DC))
4746 << Name << cast<NamedDecl>(Cur) << cast<NamedDecl>(DC) << SS.getRange();
4806 DeclContext *DC = CurContext;
4815 DC = computeDeclContext(D.getCXXScopeSpec(), EnteringContext);
4816 if (!DC || isa<EnumDecl>(DC)) {
4827 bool IsDependentContext = DC->isDependentContext();
4830 RequireCompleteDeclContext(D.getCXXScopeSpec(), DC))
4834 if (isa<CXXRecordDecl>(DC) && !cast<CXXRecordDecl>(DC)->hasDefinition()) {
4837 << Name << DC << D.getCXXScopeSpec().getRange();
4841 if (diagnoseQualifiedDeclaration(D.getCXXScopeSpec(), DC,
4843 if (DC->isRecord())
4854 ContextRAII SavedContext(*this, DC);
4863 if (!R->isFunctionType() && DiagnoseClassNameShadow(DC, NameInfo))
4906 LookupQualifiedName(Previous, DC);
4971 if (!DC->getRedeclContext()->isFileContext()) {
4987 New = ActOnTypedefDeclarator(S, D, DC, TInfo, Previous);
4989 New = ActOnFunctionDeclarator(S, D, DC, TInfo, Previous,
4993 New = ActOnVariableDeclarator(S, D, DC, TInfo, Previous, TemplateParamLists,
5178 Sema::ActOnTypedefDeclarator(Scope* S, Declarator& D, DeclContext* DC,
5186 DC = CurContext;
5214 NamedDecl *ND = ActOnTypedefNameDecl(S, DC, NewTD, Previous, Redeclaration);
5261 Sema::ActOnTypedefNameDecl(Scope *S, DeclContext *DC, TypedefNameDecl *NewTD,
5265 FilterLookupForScope(Previous, DC, S, /*ConsiderLinkage*/false,
5303 /// \param DC the context in which the new declaration is being
5309 isOutOfScopePreviousDeclaration(NamedDecl *PrevDecl, DeclContext *DC,
5324 DeclContext *OuterContext = DC->getRedeclContext();
5620 const DeclContext *DC = VD->getDeclContext()->getRedeclContext();
5621 if (DC->isFunctionOrMethod())
5623 if (DC->isFileContext())
5625 if (DC->isRecord())
5631 const DeclContext *DC = FD->getDeclContext()->getRedeclContext();
5632 if (DC->isFileContext() || DC->isFunctionOrMethod())
5634 if (DC->isRecord())
5666 bool Sema::adjustContextForLocalExternDecl(DeclContext *&DC) {
5667 if (!DC->isFunctionOrMethod())
5673 if (DC->isDependentContext())
5683 while (!DC->isFileContext() && !isa<LinkageSpecDecl>(DC))
5684 DC = DC->getParent();
5699 Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
5711 if (SC == SC_None && !DC->isRecord() &&
5716 DeclContext *OriginalDC = DC;
5718 adjustContextForLocalExternDecl(DC);
5771 if (!DC->isRecord() && S->getFnParent() == nullptr) {
5815 NewVD = VarDecl::Create(Context, DC, D.getLocStart(),
5827 if (DC->isRecord() && !CurContext->isRecord()) {
5855 if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC)) {
5938 NewVD = VarDecl::Create(Context, DC, D.getLocStart(),
5944 VarTemplateDecl::Create(Context, DC, D.getIdentifierLoc(), Name,
6014 !DC->isFunctionOrMethod()))
6227 (D.getCXXScopeSpec().isSet() && DC && DC->isRecord() &&
6228 DC->isDependentContext())
6782 bool Sema::AddOverriddenMethods(CXXRecordDecl *DC, CXXMethodDecl *MD) {
6791 if (DC->lookupInBases(FOM, Paths)) {
7057 DeclContext *DC, QualType &R,
7077 NewFD = FunctionDecl::Create(SemaRef.Context, DC,
7093 if (!DC->isRecord() &&
7101 assert(DC->isRecord() &&
7105 return CXXConstructorDecl::Create(SemaRef.Context, cast<CXXRecordDecl>(DC),
7113 if (DC->isRecord()) {
7115 CXXRecordDecl *Record = cast<CXXRecordDecl>(DC);
7140 return FunctionDecl::Create(SemaRef.Context, DC,
7148 if (!DC->isRecord()) {
7156 return CXXConversionDecl::Create(SemaRef.Context, cast<CXXRecordDecl>(DC),
7161 } else if (DC->isRecord()) {
7167 Name.getAsIdentifierInfo() == cast<CXXRecordDecl>(DC)->getIdentifier()){
7176 cast<CXXRecordDecl>(DC),
7191 return FunctionDecl::Create(SemaRef.Context, DC,
7379 Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
7412 DeclContext *OriginalDC = DC;
7413 bool IsLocalExternDecl = adjustContextForLocalExternDecl(DC);
7415 FunctionDecl *NewFD = CreateNewFunctionDecl(*this, D, DC, R, TInfo, SC,
7492 if (DC->isDependentContext()) {
7493 ContextRAII SavedContext(*this, DC);
7499 FunctionTemplate = FunctionTemplateDecl::Create(Context, DC,
7749 if (isa<CXXMethodDecl>(NewFD) && DC == CurContext &&
8003 (NewFD->getType()->isDependentType() || DC->isDependentContext() ||
8084 if (NewFD->isOverloadedOperator() && !DC->isRecord() &&
8101 DC && DC->isRecord() &&
8102 DC->isDependentContext())
8205 if (!DC->isRecord() && NewFD->isExternallyVisible())
10213 const DeclContext *DC = VD->getDeclContext();
10216 if (DC->getRedeclContext()->isFileContext() && VD->isExternallyVisible())
10501 ParmVarDecl *Sema::BuildParmVarDeclForTypedef(DeclContext *DC,
10507 ParmVarDecl *Param = ParmVarDecl::Create(Context, DC, Loc, Loc, nullptr,
10559 ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc,
10586 ParmVarDecl *New = ParmVarDecl::Create(Context, DC, StartLoc, NameLoc, Name,
11759 DeclContext *DC = ND->getDeclContext()->getRedeclContext();
11760 for (; !DC->isTranslationUnit(); DC = DC->getParent()) {
11763 NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(DC);
11778 if (DC->isTranslationUnit())
11918 DeclContext *DC = CurContext;
11938 DC = computeDeclContext(SS, false);
11939 if (!DC) {
11944 DC = computeDeclContext(SS, true);
11945 if (!DC) {
11952 if (RequireCompleteDeclContext(SS, DC))
11955 SearchDC = DC;
11957 LookupQualifiedName(Previous, DC);
11977 << Kind << Name << DC << SS.getRange();
12030 DeclContext *DC = ND->getDeclContext()->getRedeclContext();
12031 if (DC->isFileContext() &&
12072 if (getLangOpts().CPlusPlus && Name && DC && StdNamespace &&
12073 DC->Equals(getStdNamespace()) && Name->isStr("bad_alloc")) {
12359 // of reference, make sure we build the redeclaration in the same DC
12534 diagnoseQualifiedDeclaration(SS, DC, OrigName, Loc))
12629 DeclContext *DC = New->getDeclContext()->getRedeclContext();
12630 DC->makeDeclVisibleInContext(New);
12632 if (Scope *EnclosingScope = getScopeForDeclContext(S, DC))
12758 void Sema::ActOnObjCTemporaryExitContainerContext(DeclContext *DC) {
12759 assert(DC == CurContext && "Mismatch of container contexts");
12760 OriginalLexicalContext = DC;
12764 void Sema::ActOnObjCReenterContainerContext(DeclContext *DC) {
12765 ActOnObjCContainerStartDefinition(cast<Decl>(DC));
13406 ObjCContainerDecl *DC = cast<ObjCContainerDecl>(EnclosingDecl);
13407 switch (DC->getKind()) {
13410 Context.ResetObjCLayout(cast<ObjCCategoryDecl>(DC)->getClassInterface());
13414 ResetObjCLayout(cast<ObjCImplementationDecl>(DC)->getClassInterface());
14567 SourceLocation ImportLoc, DeclContext *DC,
14571 if (auto *LSD = dyn_cast<LinkageSpecDecl>(DC)) {
14580 DC = LSD->getParent();
14583 while (isa<LinkageSpecDecl>(DC))
14584 DC = DC->getParent();
14586 if (!isa<TranslationUnitDecl>(DC)) {
14590 << M->getFullModuleName() << DC;
14591 S.Diag(cast<Decl>(DC)->getLocStart(),
14592 diag::note_module_import_not_at_top_level) << DC;