Sema::getTypeName.
"LookupNestedNameSpecifierName" isn't quite the right kind of lookup, though;
it doesn't ignore namespaces. Someone more familiar with the lookup code
should fix this properly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91809
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!LookupCtx->isDependentContext() && RequireCompleteDeclContext(*SS))
return 0;
}
-
- LookupResult Result(*this, &II, NameLoc, LookupOrdinaryName);
+
+ // FIXME: LookupNestedNameSpecifierName isn't the right kind of
+ // lookup for class-names.
+ LookupNameKind Kind = isClassName ? LookupNestedNameSpecifierName :
+ LookupOrdinaryName;
+ LookupResult Result(*this, &II, NameLoc, Kind);
if (LookupCtx) {
// Perform "qualified" name lookup into the declaration context we
// computed, which is either the type of the base of a member access
--- /dev/null
+// RUN: %clang_cc1 %s -fsyntax-only -verify
+
+// "During the lookup for a base class name, non-type names are ignored"
+namespace PR5840 {
+ struct Base {};
+ int Base = 10;
+ struct Derived : Base {};
+}