aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2012-01-13 21:28:55 +0000
committerKaelyn Uhrain <rikka@google.com>2012-01-13 21:28:55 +0000
commite4c7f90da208ed2caeab784b32f416a50eed8da3 (patch)
tree8346b0b73153434caf5fcc8976a3a5d4e51cb81c /test
parent43115d4904431917ef6852ee089a8520b9940ba5 (diff)
Convert SemaExprMember.cpp to pass a callback object to CorrectTypo,
improving the typo correction results in certain situations. This is also the first typo correction callback conversion to affect an existing unit test. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaCXX/member-expr.cpp4
-rw-r--r--test/SemaCXX/typo-correction.cpp6
2 files changed, 7 insertions, 3 deletions
diff --git a/test/SemaCXX/member-expr.cpp b/test/SemaCXX/member-expr.cpp
index db5a051826..dbddd1c2e3 100644
--- a/test/SemaCXX/member-expr.cpp
+++ b/test/SemaCXX/member-expr.cpp
@@ -94,11 +94,11 @@ namespace test5 {
namespace PR7508 {
struct A {
struct CleanupScope {};
- void PopCleanupBlock();
+ void PopCleanupBlock(); // expected-note{{'PopCleanupBlock' declared here}}
};
void foo(A &a) {
- a.PopCleanupScope(); // expected-error{{no member named 'PopCleanupScope' in 'PR7508::A'}}
+ a.PopCleanupScope(); // expected-error{{no member named 'PopCleanupScope' in 'PR7508::A'; did you mean 'PopCleanupBlock'?}}
}
}
diff --git a/test/SemaCXX/typo-correction.cpp b/test/SemaCXX/typo-correction.cpp
index a4cbbb85e6..bc3433b598 100644
--- a/test/SemaCXX/typo-correction.cpp
+++ b/test/SemaCXX/typo-correction.cpp
@@ -37,10 +37,14 @@ inline error_condition make_error_condition(errc _e) {
// refer to a base class or non-static data member.
struct BaseType { };
struct Derived : public BaseType { // expected-note {{base class 'BaseType' specified here}}
- static int base_type;
+ static int base_type; // expected-note {{'base_type' declared here}}
Derived() : basetype() {} // expected-error{{initializer 'basetype' does not name a non-static data member or base class; did you mean the base class 'BaseType'?}}
};
+int get_type(struct Derived *st) {
+ return st->Base_Type; // expected-error{{no member named 'Base_Type' in 'Derived'; did you mean 'base_type'?}}
+}
+
// In this example, somename should not be corrected to the cached correction
// "some_name" since "some_name" is a class and a namespace name is needed.
class some_name {}; // expected-note {{'some_name' declared here}}