Fix a bug in getFriendObjectKind where we would clear out all mask bits except IDNS_TagFriend and IDNS_OrdinaryFriend but then check for IDNS_Tag and IDNS_Ordinary.

llvm-svn: 81730
This commit is contained in:
Anders Carlsson 2009-09-13 23:59:13 +00:00
parent 64f18eceaf
commit 40a90c8754
2 changed files with 12 additions and 1 deletions

View File

@ -443,7 +443,8 @@ public:
unsigned mask
= (IdentifierNamespace & (IDNS_TagFriend | IDNS_OrdinaryFriend));
if (!mask) return FOK_None;
return (mask & (IDNS_Tag | IDNS_Ordinary) ? FOK_Declared : FOK_Undeclared);
return (IdentifierNamespace & (IDNS_Tag | IDNS_Ordinary) ?
FOK_Declared : FOK_Undeclared);
}
// Implement isa/cast/dyncast/etc.

View File

@ -0,0 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s
template<typename T> struct A {
struct B { };
friend struct B;
};
void f() {
A<int>::B b;
}