summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/typo-correction.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2013-07-02 23:47:35 +0000
committerKaelyn Uhrain <rikka@google.com>2013-07-02 23:47:35 +0000
commitb18b0c0f16c63585f69d72bc0991c1c09c813220 (patch)
treed26a00c090aeb4f88a99b69b53ed10761164cd05 /clang/test/SemaCXX/typo-correction.cpp
parentac8062bb724136609f422be9c5a82d3514645011 (diff)
downloadbcm5719-llvm-b18b0c0f16c63585f69d72bc0991c1c09c813220.tar.gz
bcm5719-llvm-b18b0c0f16c63585f69d72bc0991c1c09c813220.zip
Look for corrections in enclosing namespaces that require a global NestedNameSpecifier.
CorrectTypo will now see and consider those corrections that are effectively shadowed by other declarations in a closer context when resolved via an unqualified lookup. This involves adding any parent namespaces to the set of namespaces as fully-qualified name specifiers, and also adding potential corrections that passed name lookup but were rejected by the given CorrectionCandidateCallback into the set of failed corrections that should be tried with the set of namespace specifiers. llvm-svn: 185486
Diffstat (limited to 'clang/test/SemaCXX/typo-correction.cpp')
-rw-r--r--clang/test/SemaCXX/typo-correction.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/typo-correction.cpp b/clang/test/SemaCXX/typo-correction.cpp
index 3d40d842f0e..62d870c826e 100644
--- a/clang/test/SemaCXX/typo-correction.cpp
+++ b/clang/test/SemaCXX/typo-correction.cpp
@@ -230,6 +230,18 @@ class foo { }; // expected-note{{'foo' declared here}}
class bar : boo { }; // expected-error{{unknown class name 'boo'; did you mean 'foo'?}}
}
+namespace outer {
+ void somefunc(); // expected-note{{'::outer::somefunc' declared here}}
+ void somefunc(int, int); // expected-note{{'::outer::somefunc' declared here}}
+
+ namespace inner {
+ void somefunc(int) {
+ someFunc(); // expected-error{{use of undeclared identifier 'someFunc'; did you mean '::outer::somefunc'?}}
+ someFunc(1, 2); // expected-error{{use of undeclared identifier 'someFunc'; did you mean '::outer::somefunc'?}}
+ }
+ }
+}
+
namespace bogus_keyword_suggestion {
void test() {
status = "OK"; // expected-error-re{{use of undeclared identifier 'status'$}}
OpenPOWER on IntegriCloud