Fixes a crash-on-valid introduced by r188486 (which should've occurred
earlier but for a blatant bug where calling createFwdDecl from the
requireCompleteType callback was useless under -flimit-debug-info and we
were just getting lucky with other later callbacks requiring the type
anyway).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188622
91177308-0d34-0410-b5e6-
96231b3b80d8
if ((*BI)->isUnsupportedFriend())
continue;
if (TypeSourceInfo *TInfo = (*BI)->getFriendType())
- EltTys.push_back(DBuilder.createFriend(RecordTy,
- getOrCreateType(TInfo->getType(),
- Unit)));
+ EltTys.push_back(DBuilder.createFriend(
+ RecordTy, getOrCreateType(TInfo->getType(), Unit, true)));
}
}
-// RUN: %clang -fverbose-asm -S -g %s -o - | grep DW_TAG_friend
+// RUN: %clang -emit-llvm -S -g %s -o - | FileCheck %s
class MyFriend;
-class SomeClass
-{
- friend class MyFriend;
+class SomeClass {
+ friend class MyFriend;
+ typedef int SomeType;
};
-SomeClass sc;
+SomeClass *x;
+struct MyFriend {
+ static void func(SomeClass::SomeType) {
+ }
+};
+
+// CHECK: DW_TAG_friend