diff options
author | Kaelyn Uhrain <rikka@google.com> | 2013-09-27 23:54:23 +0000 |
---|---|---|
committer | Kaelyn Uhrain <rikka@google.com> | 2013-09-27 23:54:23 +0000 |
commit | 30943ce6fddfade276882f86460abcd5787f3048 (patch) | |
tree | 847f9624e5faf4b4dc75d4678c3ac7fc12770402 | |
parent | c7cda27f79e7f8de7ede70e589c9cf6d5a06beca (diff) | |
download | bcm5719-llvm-30943ce6fddfade276882f86460abcd5787f3048.tar.gz bcm5719-llvm-30943ce6fddfade276882f86460abcd5787f3048.zip |
Don't suggest namespaces if the next token is a '.'
llvm-svn: 191589
-rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 3 | ||||
-rw-r--r-- | clang/test/SemaCXX/typo-correction-pt2.cpp | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index f4b03f32f56..28580ab2bb7 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -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); } diff --git a/clang/test/SemaCXX/typo-correction-pt2.cpp b/clang/test/SemaCXX/typo-correction-pt2.cpp index e91ed7d18b5..1ccd103ecff 100644 --- a/clang/test/SemaCXX/typo-correction-pt2.cpp +++ b/clang/test/SemaCXX/typo-correction-pt2.cpp @@ -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'$}} +} +} |