Skip to content

Commit 546361b

Browse files
fixing record decl
1 parent 715058e commit 546361b

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

clang/lib/AST/DeclBase.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,11 +1471,6 @@ 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;
14791474
default:
14801475
if (getDeclKind() >= Decl::firstTag && getDeclKind() <= Decl::lastTag) {
14811476
// If this is a tag type that has a definition or is currently

clang/lib/Sema/HLSLExternalSemaSource.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct BuiltinTypeDeclBuilder {
6767
Record = CXXRecordDecl::Create(AST, TagDecl::TagKind::Class, HLSLNamespace,
6868
SourceLocation(), SourceLocation(), &II,
6969
PrevDecl, true);
70+
Record->startDefinition();
7071
Record->setImplicit(true);
7172
Record->setLexicalDeclContext(HLSLNamespace);
7273
Record->setHasExternalLexicalStorage();

clang/test/AST/HLSL/ByteAddressBuffer-AST.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ByteAddressBuffer Buffer;
1818

1919

2020
// CHECK: FinalAttr 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> Implicit final
21-
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit h '__hlsl_resource_t
21+
// CHECK-NEXT: FieldDecl 0x{{[0-9A-Fa-f]+}} <<invalid sloc>> <invalid sloc> implicit __handle '__hlsl_resource_t
2222
// CHECK-SAME{LITERAL}: [[hlsl::resource_class(SRV)]]
2323
// CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]]
2424
// CHECK-SAME{LITERAL}: [[hlsl::contained_type(char8_t)]]

0 commit comments

Comments
 (0)