From 98e13eac132c16466b75af3fd2365be09130e9d6 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 20 Oct 2011 01:41:28 +0000 Subject: [PATCH] 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 --- test/FixIt/fixit.cpp | 23 ++++++++++++----------- 1 file 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; }