blob: ee93755775e5b4806a0ecdf1077e48a122ec8d37 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -pedantic -Wall -fixit %s -o - | %clang_cc1 -fsyntax-only -pedantic -Wall -Werror -x c++ -
2
3/* This is a test of the various code modification hints that are
4 provided as part of warning or extension diagnostics. All of the
5 warnings will be fixed by -fixit, and the resulting file should
6 compile cleanly with -Werror -pedantic. */
7
8struct C1 {
9 virtual void f();
10 static void g();
11};
12struct C2 : virtual public virtual C1 { }; // expected-error{{duplicate}}
13
14virtual void C1::f() { } // expected-error{{'virtual' can only be specified inside the class definition}}
15
16static void C1::g() { } // expected-error{{'static' can only be specified inside the class definition}}
17
18template<int Value> struct CT { }; // expected-note{{previous use is here}}
19
20CT<10 >> 2> ct; // expected-warning{{require parentheses}}
21
22class C3 {
23public:
24 C3(C3, int i = 0); // expected-error{{copy constructor must pass its first argument by reference}}
25};
26
27struct CT<0> { }; // expected-error{{'template<>'}}
28
29template<> class CT<1> { }; // expected-error{{tag type}}
30
31// Access declarations
32class A {
33protected:
34 int foo();
35};
36
37class B : public A {
38 A::foo; // expected-warning{{access declarations are deprecated}}
39};