Recognize that EnumConstantDecls can be found by lookup and are not instance

members.  Fixes PR5667.

llvm-svn: 90341
This commit is contained in:
John McCall 2009-12-02 19:59:55 +00:00
parent 9732915bf9
commit 1a49e9dc87
2 changed files with 18 additions and 0 deletions

View File

@ -733,6 +733,9 @@ static bool IsProvablyNotDerivedFrom(Sema &SemaRef,
} }
static bool IsInstanceMember(NamedDecl *D) { static bool IsInstanceMember(NamedDecl *D) {
if (isa<EnumConstantDecl>(D))
return false;
assert(isa<CXXRecordDecl>(D->getDeclContext()) && assert(isa<CXXRecordDecl>(D->getDeclContext()) &&
"checking whether non-member is instance member"); "checking whether non-member is instance member");

View File

@ -109,3 +109,18 @@ struct Undef { // expected-note{{definition of 'struct Undef' is not complete un
int Undef::f() { int Undef::f() {
return sizeof(Undef); return sizeof(Undef);
} }
// PR clang/5667
namespace test1 {
template <typename T> struct is_class {
enum { value = 0 };
};
template <typename T> class ClassChecker {
bool isClass() {
return is_class<T>::value;
}
};
template class ClassChecker<int>;
}