зеркало из https://github.com/microsoft/clang.git
For friend class decls, always use TK_Reference so we'll try to look up existing class decls first.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71481 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
e88a170da9
Коммит
5dc2af12bd
|
@ -455,7 +455,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
|
|||
Action::TagKind TK;
|
||||
if (Tok.is(tok::l_brace) || (getLang().CPlusPlus && Tok.is(tok::colon)))
|
||||
TK = Action::TK_Definition;
|
||||
else if (Tok.is(tok::semi))
|
||||
else if (Tok.is(tok::semi) && !DS.isFriendSpecified())
|
||||
TK = Action::TK_Declaration;
|
||||
else
|
||||
TK = Action::TK_Reference;
|
||||
|
|
|
@ -3,3 +3,15 @@
|
|||
class C {
|
||||
friend class D;
|
||||
};
|
||||
|
||||
class A {
|
||||
public:
|
||||
void f();
|
||||
};
|
||||
|
||||
class B {
|
||||
// 'A' here should refer to the declaration above.
|
||||
friend class A;
|
||||
|
||||
void f(A *a) { a->f(); }
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче