A forward declaration inside a module header does not belong to the module.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249157
91177308-0d34-0410-b5e6-
96231b3b80d8
}
llvm::DIModule *CGDebugInfo::getParentModuleOrNull(const Decl *D) {
+ // A forward declaration inside a module header does not belong to the module.
+ if (isa<RecordDecl>(D) && !cast<RecordDecl>(D)->getDefinition())
+ return nullptr;
if (DebugTypeExtRefs && D->isFromASTFile()) {
// Record a reference to an imported clang module or precompiled header.
auto *Reader = CGM.getContext().getExternalSource();
}
+ classMethod;
- instanceMethodWithInt:(int)i;
+- (struct OpaqueData*) getSomethingOpaque;
@property int property;
@end
// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type,
// MODULE-CHECK-SAME: name: "ObjCClass",
// MODULE-CHECK-SAME: scope: ![[MODULE]],
+
+// The forward declaration should not be in the module scope.
+// MODULE-CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "OpaqueData", file