[cfe-commits] r90341 - in /cfe/trunk: lib/Sema/SemaExpr.cpp test/SemaCXX/qualified-id-lookup.cpp
John McCall
rjmccall at apple.com
Wed Dec 2 11:59:55 PST 2009
Author: rjmccall
Date: Wed Dec 2 13:59:55 2009
New Revision: 90341
URL: http://llvm.org/viewvc/llvm-project?rev=90341&view=rev
Log:
Recognize that EnumConstantDecls can be found by lookup and are not instance
members. Fixes PR5667.
Modified:
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/SemaCXX/qualified-id-lookup.cpp
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=90341&r1=90340&r2=90341&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Dec 2 13:59:55 2009
@@ -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");
Modified: cfe/trunk/test/SemaCXX/qualified-id-lookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/qualified-id-lookup.cpp?rev=90341&r1=90340&r2=90341&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/qualified-id-lookup.cpp (original)
+++ cfe/trunk/test/SemaCXX/qualified-id-lookup.cpp Wed Dec 2 13:59:55 2009
@@ -109,3 +109,18 @@
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>;
+}
More information about the cfe-commits
mailing list