summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Parse/ParseStmt.cpp3
-rw-r--r--clang/test/SemaCXX/typo-correction-pt2.cpp7
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'$}}
+}
+}
OpenPOWER on IntegriCloud