blob: 9741d4af3c22bbe1280a6d22798807a4d77c37bb [file] [log] [blame]
Douglas Gregor558cb562009-04-02 01:08:08 +00001// RUN: clang-cc -fsyntax-only -pedantic -fixit %s -o - | clang-cc -fsyntax-only -pedantic -Werror -x c++ -
Douglas Gregor9b3064b2009-04-01 22:41:11 +00002
3/* This is a test of the various code modification hints that are
4 provided as part of warning or extension diagnostics. Eventually,
5 we would like to actually try to perform the suggested
6 modifications and compile the result to test that no warnings
7 remain. */
8
Douglas Gregora3a83512009-04-01 23:51:29 +00009struct C1 {
10 virtual void f();
11 static void g();
12};
Douglas Gregor9b3064b2009-04-01 22:41:11 +000013struct C2 : virtual public virtual C1 { }; // expected-error{{duplicate}}
14
Douglas Gregora3a83512009-04-01 23:51:29 +000015virtual void C1::f() { } // expected-error{{'virtual' can only be specified inside the class definition}}
16
17static void C1::g() { } // expected-error{{'static' can only be specified inside the class definition}}
18
19template<int Value> struct CT { }; // expected-note{{previous use is here}}
Douglas Gregor9b3064b2009-04-01 22:41:11 +000020
21CT<10 >> 2> ct; // expected-warning{{require parentheses}}
Douglas Gregora3a83512009-04-01 23:51:29 +000022
23class C3 {
24public:
25 C3(C3, int i = 0); // expected-error{{copy constructor must pass its first argument by reference}}
26};
27
28struct CT<0> { }; // expected-error{{'template<>'}}
29
30template<> class CT<1> { }; // expected-error{{tag type}}