continue;
}
+ // If this is a file context, we need to perform unqualified name
+ // lookup considering using directives.
+ if (Ctx->isFileContext()) {
+ UnqualUsingDirectiveSet UDirs;
+ UDirs.visit(Ctx, Ctx);
+ UDirs.done();
+
+ if (CppNamespaceLookup(*this, R, Context, Ctx, UDirs)) {
+ R.resolveKind();
+ return true;
+ }
+
+ continue;
+ }
+
// Perform qualified name lookup into this context.
// FIXME: In some cases, we know that every name that could be found by
// this qualified name lookup will also be on the identifier chain. For
// Unqualified name lookup in C++ requires looking into scopes
// that aren't strictly lexical, and therefore we walk through the
// context as well as walking through the scopes.
-
for (; S; S = S->getParent()) {
// Check whether the IdResolver has anything in this scope.
bool Found = false;
int i = 2;
N::S N::j = i;
N::S N::j2(i);
+
+// <rdar://problem/13317030>
+namespace M {
+ class X { };
+ inline X operator-(int, X);
+
+ template<typename T>
+ class Y { };
+
+ typedef Y<float> YFloat;
+
+ namespace yfloat {
+ YFloat operator-(YFloat, YFloat);
+ }
+ using namespace yfloat;
+}
+
+using namespace M;
+
+namespace M {
+
+class Other {
+ void foo(YFloat a, YFloat b);
+};
+
+}
+
+void Other::foo(YFloat a, YFloat b) {
+ YFloat c = a - b;
+}