2009-11-14 12:39:42 +08:00
|
|
|
// RUN: clang-cc -pedantic -fixit %s -o - | clang-cc -fsyntax-only -pedantic -Werror -x c++ -
|
2009-04-02 06:41:11 +08:00
|
|
|
|
|
|
|
/* This is a test of the various code modification hints that are
|
2009-04-02 11:20:30 +08:00
|
|
|
provided as part of warning or extension diagnostics. All of the
|
|
|
|
warnings will be fixed by -fixit, and the resulting file should
|
|
|
|
compile cleanly with -Werror -pedantic. */
|
2009-04-02 06:41:11 +08:00
|
|
|
|
2009-04-02 07:51:29 +08:00
|
|
|
struct C1 {
|
|
|
|
virtual void f();
|
|
|
|
static void g();
|
|
|
|
};
|
2009-04-02 06:41:11 +08:00
|
|
|
struct C2 : virtual public virtual C1 { }; // expected-error{{duplicate}}
|
|
|
|
|
2009-04-02 07:51:29 +08:00
|
|
|
virtual void C1::f() { } // expected-error{{'virtual' can only be specified inside the class definition}}
|
|
|
|
|
|
|
|
static void C1::g() { } // expected-error{{'static' can only be specified inside the class definition}}
|
|
|
|
|
|
|
|
template<int Value> struct CT { }; // expected-note{{previous use is here}}
|
2009-04-02 06:41:11 +08:00
|
|
|
|
|
|
|
CT<10 >> 2> ct; // expected-warning{{require parentheses}}
|
2009-04-02 07:51:29 +08:00
|
|
|
|
|
|
|
class C3 {
|
|
|
|
public:
|
|
|
|
C3(C3, int i = 0); // expected-error{{copy constructor must pass its first argument by reference}}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CT<0> { }; // expected-error{{'template<>'}}
|
|
|
|
|
|
|
|
template<> class CT<1> { }; // expected-error{{tag type}}
|
2009-11-10 11:24:44 +08:00
|
|
|
|
|
|
|
// PR5444
|
|
|
|
namespace PR5444 {
|
|
|
|
void foo(int x, int y = 0);
|
|
|
|
void foo(int x, int y = 0) { }
|
|
|
|
|
|
|
|
void foo(int = 0);
|
|
|
|
void foo(int = 0) { }
|
|
|
|
}
|