From 2ceb67a5345ef711468a32dbf17769828b5fbadd Mon Sep 17 00:00:00 2001 From: Kaelyn Uhrain Date: Fri, 27 Sep 2013 23:54:23 +0000 Subject: [PATCH] Don't suggest namespaces if the next token is a '.' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191589 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseStmt.cpp | 3 +++ test/SemaCXX/typo-correction-pt2.cpp | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index f4b03f32f5..28580ab2bb 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -132,6 +132,9 @@ public: return isa(FD); if (NextToken.is(tok::equal)) return candidate.getCorrectionDeclAs(); + if (NextToken.is(tok::period) && + candidate.getCorrectionDeclAs()) + return false; return CorrectionCandidateCallback::ValidateCandidate(candidate); } diff --git a/test/SemaCXX/typo-correction-pt2.cpp b/test/SemaCXX/typo-correction-pt2.cpp index e91ed7d18b..1ccd103ecf 100644 --- a/test/SemaCXX/typo-correction-pt2.cpp +++ b/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'$}} +} +} -- 2.50.1