Skip to content

Commit 1aebbf9

Browse files
adding new CXXRecord decl primary context
1 parent c819137 commit 1aebbf9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/AST/DeclBase.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,11 @@ DeclContext *DeclContext::getPrimaryContext() {
14711471
case Decl::ObjCCategoryImpl:
14721472
return this;
14731473

1474+
case Decl::CXXRecord:
1475+
if (auto *OPD = dyn_cast<CXXRecordDecl>(this))
1476+
if (auto *Def = OPD->getDefinition())
1477+
return Def;
1478+
return this;
14741479
default:
14751480
if (getDeclKind() >= Decl::firstTag && getDeclKind() <= Decl::lastTag) {
14761481
// If this is a tag type that has a definition or is currently

0 commit comments

Comments
 (0)