aboutsummaryrefslogtreecommitdiff
path: root/test/FixIt/fixit.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-10-20 01:41:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-10-20 01:41:28 +0000
commit98e13eac132c16466b75af3fd2365be09130e9d6 (patch)
tree650fc0f6ff3beac4a1176c4e8730633307c81dd3 /test/FixIt/fixit.cpp
parent85037d987a68b8bc9db22e4e1c18cac80b74ea1c (diff)
Make the -verify bits in this test actually test something, and fix a few cases
where the test didn't work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142563 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt/fixit.cpp')
-rw-r--r--test/FixIt/fixit.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp
index dff8a37820..86b397777c 100644
--- a/test/FixIt/fixit.cpp
+++ b/test/FixIt/fixit.cpp
@@ -1,6 +1,7 @@
+// RUN: %clang_cc1 -pedantic -Wall -verify -fcxx-exceptions -x c++ %s
// RUN: cp %s %t
-// RUN: not %clang_cc1 -pedantic -Wall -fixit -x c++ %t
-// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x c++ %t
+// RUN: not %clang_cc1 -pedantic -Wall -fcxx-exceptions -fixit -x c++ %t
+// RUN: %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -fcxx-exceptions -x c++ %t
/* This is a test of the various code modification hints that are
provided as part of warning or extension diagnostics. All of the
@@ -28,7 +29,7 @@ public:
struct CT<0> { }; // expected-error{{'template<>'}}
-template<> class CT<1> { }; // expected-error{{tag type}}
+template<> union CT<1> { }; // expected-error{{tag type}}
// Access declarations
class A {
@@ -40,7 +41,7 @@ class B : public A {
A::foo; // expected-warning{{access declarations are deprecated}}
};
-void f() throw();
+void f() throw(); // expected-note{{previous}}
void f(); // expected-warning{{missing exception specification}}
namespace rdar7853795 {
@@ -63,7 +64,7 @@ namespace rdar7796492 {
// extra qualification on member
class C {
- int C::foo();
+ int C::foo(); // expected-warning {{extra qualification}}
};
namespace rdar8488464 {
@@ -104,7 +105,7 @@ void test (BD &br) {
AD* aPtr;
BD b;
aPtr = b; // expected-error {{assigning to 'AD *' from incompatible type 'BD'; take the address with &}}
- aPtr = br; // expected-error {{assigning to 'A *' from incompatible type 'B'; take the address with &}}
+ aPtr = br; // expected-error {{assigning to 'AD *' from incompatible type 'BD'; take the address with &}}
}
void foo1() const {} // expected-error {{type qualifier is not allowed on this function}}
@@ -114,13 +115,13 @@ void foo3() const volatile {} // expected-error {{type qualifier is not allowed
struct S { void f(int, char); };
int itsAComma,
itsAComma2 = 0,
-oopsAComma(42), // expected-error {{expected ';' after declaration}}
+oopsAComma(42), // expected-error {{expected ';' at end of declaration}}
AD oopsMoreCommas() {
- static int n = 0,
+ static int n = 0, // expected-error {{expected ';' at end of declaration}}
static char c,
- &d = c, // expected-error {{expected ';' after declaration}}
- S s, // expected-error {{expected ';' after declaration}}
+ &d = c, // expected-error {{expected ';' at end of declaration}}
+ S s, // expected-error {{expected ';' at end of declaration}}
s.f(n, d);
- AD ad, // expected-error {{expected ';' after declaration}}
+ AD ad, // expected-error {{expected ';' at end of declaration}}
return ad;
}