Don't suggest namespaces if the next token is a '.'

llvm-svn: 191589
This commit is contained in:
Kaelyn Uhrain 2013-09-27 23:54:23 +00:00
parent c7cda27f79
commit 30943ce6fd
2 changed files with 10 additions and 0 deletions

View File

@ -132,6 +132,9 @@ public:
return isa<ObjCIvarDecl>(FD);
if (NextToken.is(tok::equal))
return candidate.getCorrectionDeclAs<VarDecl>();
if (NextToken.is(tok::period) &&
candidate.getCorrectionDeclAs<NamespaceDecl>())
return false;
return CorrectionCandidateCallback::ValidateCandidate(candidate);
}

View File

@ -128,3 +128,10 @@ long readline(const char *, char *, unsigned long);
void assign_to_unknown_var() {
deadline_ = 1; // expected-error-re {{use of undeclared identifier 'deadline_'$}}
}
namespace no_ns_before_dot {
namespace re2 {}
void test() {
req.set_check(false); // expected-error-re {{use of undeclared identifier 'req'$}}
}
}