summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-01-07 00:31:29 +0000
committerDouglas Gregor <dgregor@apple.com>2010-01-07 00:31:29 +0000
commit712dcfe92183b593a8edd8cb31052e98ab368422 (patch)
treee6c1d4599692fd8644ad2e35a827228ec80da28c /clang/test
parent43a0857631abb25f2095de6092f02a718d8df1d0 (diff)
downloadbcm5719-llvm-712dcfe92183b593a8edd8cb31052e98ab368422.tar.gz
bcm5719-llvm-712dcfe92183b593a8edd8cb31052e98ab368422.zip
Fix the search for visible declarations within a Scope to ensure that
we look into a Scope that corresponds to a compound statement whose scope was combined with the scope of the function that owns it. This improves typo correction in many common cases. llvm-svn: 92879
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/FixIt/typo.cpp5
-rw-r--r--clang/test/Sema/switch.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/test/FixIt/typo.cpp b/clang/test/FixIt/typo.cpp
index 50c6d312b8c..c0570258c53 100644
--- a/clang/test/FixIt/typo.cpp
+++ b/clang/test/FixIt/typo.cpp
@@ -21,8 +21,9 @@ tring str2; // expected-error{{unknown type name 'tring'; did you mean 'string'?
::other_std::string str3; // expected-error{{no member named 'other_std' in the global namespace; did you mean 'otherstd'?}}
-float area(float radius, float pi) {
- return radious * pi; // expected-error{{use of undeclared identifier 'radious'; did you mean 'radius'?}}
+float area(float radius, // expected-note{{'radius' declared here}}
+ float pi) {
+ return radious * pi; // expected-error{{did you mean 'radius'?}}
}
bool test_string(std::string s) {
diff --git a/clang/test/Sema/switch.c b/clang/test/Sema/switch.c
index f815ba4627f..08ab0e0ebd7 100644
--- a/clang/test/Sema/switch.c
+++ b/clang/test/Sema/switch.c
@@ -76,7 +76,7 @@ void test6() {
}
// PR5606
-int f0(int var) {
+int f0(int var) { // expected-note{{'var' declared here}}
switch (va) { // expected-error{{use of undeclared identifier 'va'}}
case 1:
break;
OpenPOWER on IntegriCloud