forked from OSchip/llvm-project
Recognize that EnumConstantDecls can be found by lookup and are not instance
members. Fixes PR5667. llvm-svn: 90341
This commit is contained in:
parent
9732915bf9
commit
1a49e9dc87
|
@ -733,6 +733,9 @@ static bool IsProvablyNotDerivedFrom(Sema &SemaRef,
|
|||
}
|
||||
|
||||
static bool IsInstanceMember(NamedDecl *D) {
|
||||
if (isa<EnumConstantDecl>(D))
|
||||
return false;
|
||||
|
||||
assert(isa<CXXRecordDecl>(D->getDeclContext()) &&
|
||||
"checking whether non-member is instance member");
|
||||
|
||||
|
|
|
@ -109,3 +109,18 @@ struct Undef { // expected-note{{definition of 'struct Undef' is not complete un
|
|||
int Undef::f() {
|
||||
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>;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue