Recognize that EnumConstantDecls can be found by lookup and are not instance
members. Fixes PR5667.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90341 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 01c7796..8e1e0af 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -733,6 +733,9 @@
}
static bool IsInstanceMember(NamedDecl *D) {
+ if (isa<EnumConstantDecl>(D))
+ return false;
+
assert(isa<CXXRecordDecl>(D->getDeclContext()) &&
"checking whether non-member is instance member");