diff options
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 3 | ||||
-rw-r--r-- | test/FixIt/typo.cpp | 10 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 1419ceb4b6..b86b31896c 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1966,8 +1966,7 @@ static void LookupVisibleDecls(Scope *S, LookupResult &Result, return; DeclContext *Entity = 0; - if (S->getEntity() && - !((DeclContext *)S->getEntity())->isFunctionOrMethod()) { + if (S->getEntity()) { // Look into this scope's declaration context, along with any of its // parent lookup contexts (e.g., enclosing classes), up to the point // where we hit the context stored in the next outer scope. diff --git a/test/FixIt/typo.cpp b/test/FixIt/typo.cpp index 581cd25f9a..041b86a7f2 100644 --- a/test/FixIt/typo.cpp +++ b/test/FixIt/typo.cpp @@ -40,4 +40,14 @@ struct Derived : public Base { Derived() : base(), // expected-error{{initializer 'base' does not name a non-static data member or base class; did you mean the base class 'Base'?}} ember() { } // expected-error{{initializer 'ember' does not name a non-static data member or base class; did you mean the member 'member'?}} + + int getMember() const { + return ember; // expected-error{{use of undeclared identifier 'ember'; did you mean 'member'?}} + } + + int &getMember(); }; + +int &Derived::getMember() { + return ember; // expected-error{{use of undeclared identifier 'ember'; did you mean 'member'?}} +} |