Add some more code modification hints
llvm-svn: 68261
diff --git a/clang/test/Sema/fixit-errors.c b/clang/test/Sema/fixit-errors.c
new file mode 100644
index 0000000..58c60ec
--- /dev/null
+++ b/clang/test/Sema/fixit-errors.c
@@ -0,0 +1,10 @@
+// RUN: clang-cc -fsyntax-only -pedantic -verify %s
+
+/* This is a test of the various code modification hints that are
+ provided as part of warning or extension diagnostics. Eventually,
+ we would like to actually try to perform the suggested
+ modifications and compile the result to test that no warnings
+ remain. */
+struct s; // expected-note{{previous use is here}}
+
+union s *s1; // expected-error{{use of 's' with tag type that does not match previous declaration}}
diff --git a/clang/test/Sema/fixit.c b/clang/test/Sema/fixit.c
index e2443cc..4bdb03d 100644
--- a/clang/test/Sema/fixit.c
+++ b/clang/test/Sema/fixit.c
@@ -16,3 +16,14 @@
struct s s0 = { y: 5 };
int array0[5] = { [3] 3 };
+
+void f1(x, y)
+{
+}
+
+int i0 = { 17 };
+
+int f2(const char *my_string) {
+ // FIXME: terminal output isn't so good when "my_string" is shorter
+ return my_string == "foo";
+}
diff --git a/clang/test/SemaCXX/fixit.cpp b/clang/test/SemaCXX/fixit.cpp
index db0cd8c..a8859ab 100644
--- a/clang/test/SemaCXX/fixit.cpp
+++ b/clang/test/SemaCXX/fixit.cpp
@@ -6,9 +6,25 @@
modifications and compile the result to test that no warnings
remain. */
-struct C1 { };
+struct C1 {
+ virtual void f();
+ static void g();
+};
struct C2 : virtual public virtual C1 { }; // expected-error{{duplicate}}
-template<int Value> struct CT { };
+virtual void C1::f() { } // expected-error{{'virtual' can only be specified inside the class definition}}
+
+static void C1::g() { } // expected-error{{'static' can only be specified inside the class definition}}
+
+template<int Value> struct CT { }; // expected-note{{previous use is here}}
CT<10 >> 2> ct; // expected-warning{{require parentheses}}
+
+class C3 {
+public:
+ C3(C3, int i = 0); // expected-error{{copy constructor must pass its first argument by reference}}
+};
+
+struct CT<0> { }; // expected-error{{'template<>'}}
+
+template<> class CT<1> { }; // expected-error{{tag type}}
diff --git a/clang/test/SemaCXX/nested-name-spec.cpp b/clang/test/SemaCXX/nested-name-spec.cpp
index 07fd5a9..fe92aab 100644
--- a/clang/test/SemaCXX/nested-name-spec.cpp
+++ b/clang/test/SemaCXX/nested-name-spec.cpp
@@ -18,12 +18,12 @@
int A::C::Ag1() { return 0; }
-static int A::C::Ag2() { return 0; } // expected-error{{'static' can not be specified on an out-of-line static member}}
+static int A::C::Ag2() { return 0; } // expected-error{{'static' can}}
int A::C::cx = 17;
-static int A::C::cx2 = 17; // expected-error{{'static' can not be specified on an out-of-line static member}}
+static int A::C::cx2 = 17; // expected-error{{'static' can}}
class C2 {
void m(); // expected-note{{member declaration nearly matches}}