summaryrefslogtreecommitdiffstats
path: root/test/FixIt
diff options
context:
space:
mode:
Diffstat (limited to 'test/FixIt')
-rw-r--r--test/FixIt/fixit-objc.m14
-rw-r--r--test/FixIt/fixit.c5
-rw-r--r--test/FixIt/typo-crash.cpp11
-rw-r--r--test/FixIt/typo.cpp12
4 files changed, 42 insertions, 0 deletions
diff --git a/test/FixIt/fixit-objc.m b/test/FixIt/fixit-objc.m
index bf704c6..2e8bfae 100644
--- a/test/FixIt/fixit-objc.m
+++ b/test/FixIt/fixit-objc.m
@@ -39,3 +39,17 @@ void f(Test *t) {
[t test:@"Foo"]]; // expected-error{{extraneous ']' before ';'}}
g(@"Foo")); // expected-error{{extraneous ')' before ';'}}
}
+
+// rdar://7861841
+@interface Radar7861841 {
+@public
+ int x;
+}
+
+@property (assign) int y;
+@end
+
+int f0(Radar7861841 *a) { return a.x; } // expected-error {{property 'x' not found on object of type 'Radar7861841 *'; did you mean to access ivar 'x'}}
+
+int f1(Radar7861841 *a) { return a->y; } // expected-error {{property 'y' found on object of type 'Radar7861841 *'; did you mean to access it with the "." operator?}}
+
diff --git a/test/FixIt/fixit.c b/test/FixIt/fixit.c
index 1a6ef63..ba45cf2 100644
--- a/test/FixIt/fixit.c
+++ b/test/FixIt/fixit.c
@@ -33,9 +33,14 @@ void f1(x, y)
int i0 = { 17 };
+#define ONE 1
+#define TWO 2
+
int test_cond(int y, int fooBar) {
// CHECK: int x = y ? 1 : 4+fooBar;
int x = y ? 1 4+foobar;
+// CHECK: x = y ? ONE : TWO;
+ x = y ? ONE TWO;
return x;
}
diff --git a/test/FixIt/typo-crash.cpp b/test/FixIt/typo-crash.cpp
new file mode 100644
index 0000000..b156e1b
--- /dev/null
+++ b/test/FixIt/typo-crash.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// FIXME: The diagnostics and recovery here are very, very poor.
+
+// PR10355
+template<typename T> void template_id1() {
+ template_id2<> t; // expected-error 2{{use of undeclared identifier 'template_id2'; did you mean 'template_id1'?}} \
+ // expected-error{{expected expression}} \
+ // expected-error{{use of undeclared identifier 't'}}
+ }
+
diff --git a/test/FixIt/typo.cpp b/test/FixIt/typo.cpp
index f8b5352..3d40da8 100644
--- a/test/FixIt/typo.cpp
+++ b/test/FixIt/typo.cpp
@@ -74,3 +74,15 @@ int foo() {
unsinged *ptr = 0; // expected-error{{use of undeclared identifier 'unsinged'; did you mean 'unsigned'?}}
return *i + *ptr + global_val; // expected-error{{use of undeclared identifier 'global_val'; did you mean 'global_value'?}}
}
+
+namespace nonstd {
+ typedef std::basic_string<char> yarn; // expected-note{{'nonstd::yarn' declared here}}
+}
+
+yarn str4; // expected-error{{unknown type name 'yarn'; did you mean 'nonstd::yarn'?}}
+
+namespace check_bool {
+ void f() {
+ Bool b; // expected-error{{use of undeclared identifier 'Bool'; did you mean 'bool'?}}
+ }
+}
OpenPOWER on IntegriCloud