+// 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
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 {
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 {
// extra qualification on member
class C {
- int C::foo();
+ int C::foo(); // expected-warning {{extra qualification}}
};
namespace rdar8488464 {
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}}
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;
}