diff options
Diffstat (limited to 'clang/test/SemaCXX')
| -rw-r--r-- | clang/test/SemaCXX/abstract.cpp | 57 | ||||
| -rw-r--r-- | clang/test/SemaCXX/access-control-check.cpp | 2 | ||||
| -rw-r--r-- | clang/test/SemaCXX/attr-format.cpp | 12 | ||||
| -rw-r--r-- | clang/test/SemaCXX/class-base-member-init.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaCXX/constructor-initializer.cpp | 14 | ||||
| -rw-r--r-- | clang/test/SemaCXX/copy-constructor-error.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaCXX/default-assignment-operator.cpp | 16 | ||||
| -rw-r--r-- | clang/test/SemaCXX/default-constructor-initializers.cpp | 6 | ||||
| -rw-r--r-- | clang/test/SemaCXX/enum.cpp | 11 | ||||
| -rw-r--r-- | clang/test/SemaCXX/illegal-member-initialization.cpp | 10 | ||||
| -rw-r--r-- | clang/test/SemaCXX/inherit.cpp | 2 | ||||
| -rw-r--r-- | clang/test/SemaCXX/member-expr-static.cpp | 18 | ||||
| -rw-r--r-- | clang/test/SemaCXX/static-initializers.cpp | 10 | ||||
| -rw-r--r-- | clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp | 8 |
14 files changed, 83 insertions, 95 deletions
diff --git a/clang/test/SemaCXX/abstract.cpp b/clang/test/SemaCXX/abstract.cpp index 2d466c203d0..e14304a26fe 100644 --- a/clang/test/SemaCXX/abstract.cpp +++ b/clang/test/SemaCXX/abstract.cpp @@ -9,7 +9,7 @@ #endif class C { - virtual void f() = 0; // expected-note {{pure virtual function 'f'}} + virtual void f() = 0; // expected-note {{pure virtual function 'f'}} }; static_assert(__is_abstract(C), "C has a pure virtual function"); @@ -20,7 +20,7 @@ class D : C { static_assert(__is_abstract(D), "D inherits from an abstract class"); class E : D { - virtual void f(); + virtual void f(); }; static_assert(!__is_abstract(E), "E inherits from an abstract class but implements f"); @@ -38,8 +38,8 @@ struct S { void t3(const C&); void f() { - C(); // expected-error {{allocation of an object of abstract type 'C'}} - t3(C()); // expected-error {{allocation of an object of abstract type 'C'}} + C(); // expected-error {{allocation of an object of abstract type 'C'}} + t3(C()); // expected-error {{allocation of an object of abstract type 'C'}} } C e1[2]; // expected-error {{variable type 'C' is an abstract class}} @@ -54,17 +54,17 @@ typedef void (*Func)(C); // expected-error {{parameter type 'C' is an abstract c void t6(Func); class F { - F a() { while (1) {} } // expected-error {{return type 'F' is an abstract class}} + F a() { while (1) {} } // expected-error {{return type 'F' is an abstract class}} - class D { - void f(F c); // expected-error {{parameter type 'F' is an abstract class}} - }; + class D { + void f(F c); // expected-error {{parameter type 'F' is an abstract class}} + }; - union U { - void u(F c); // expected-error {{parameter type 'F' is an abstract class}} - }; + union U { + void u(F c); // expected-error {{parameter type 'F' is an abstract class}} + }; - virtual void f() = 0; // expected-note {{pure virtual function 'f'}} + virtual void f() = 0; // expected-note {{pure virtual function 'f'}} }; class Abstract; @@ -72,50 +72,47 @@ class Abstract; void t7(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}} void t8() { - void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}} + void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}} } namespace N { - void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}} +void h(Abstract a); // expected-error {{parameter type 'Abstract' is an abstract class}} } class Abstract { - virtual void f() = 0; // expected-note {{pure virtual function 'f'}} + virtual void f() = 0; // expected-note {{pure virtual function 'f'}} }; // <rdar://problem/6854087> class foo { public: - virtual foo *getFoo() = 0; + virtual foo *getFoo() = 0; }; class bar : public foo { public: - virtual bar *getFoo(); + virtual bar *getFoo(); }; bar x; // <rdar://problem/6902298> -class A -{ +class A { public: - virtual void release() = 0; - virtual void release(int count) = 0; - virtual void retain() = 0; + virtual void release() = 0; + virtual void release(int count) = 0; + virtual void retain() = 0; }; -class B : public A -{ +class B : public A { public: - virtual void release(); - virtual void release(int count); - virtual void retain(); + virtual void release(); + virtual void release(int count); + virtual void retain(); }; -void foo(void) -{ - B b; +void foo(void) { + B b; } struct K { diff --git a/clang/test/SemaCXX/access-control-check.cpp b/clang/test/SemaCXX/access-control-check.cpp index d2acfe41673..fb124a932a1 100644 --- a/clang/test/SemaCXX/access-control-check.cpp +++ b/clang/test/SemaCXX/access-control-check.cpp @@ -11,6 +11,6 @@ class P { class N : M,P { N() {} - // FIXME. No access violation is reported in method call or member access. + // FIXME. No access violation is reported in method call or member access. int PR() { return iP + PPR(); } }; diff --git a/clang/test/SemaCXX/attr-format.cpp b/clang/test/SemaCXX/attr-format.cpp index d1659c98dee..369099a8480 100644 --- a/clang/test/SemaCXX/attr-format.cpp +++ b/clang/test/SemaCXX/attr-format.cpp @@ -1,8 +1,8 @@ // RUN: clang-cc -fsyntax-only -verify %s struct S { - static void f(const char*, ...) __attribute__((format(printf, 1, 2))); - - // GCC has a hidden 'this' argument in member functions which is why - // the format argument is argument 2 here. - void g(const char*, ...) __attribute__((format(printf, 2, 3))); -};
\ No newline at end of file + static void f(const char*, ...) __attribute__((format(printf, 1, 2))); + + // GCC has a hidden 'this' argument in member functions which is why + // the format argument is argument 2 here. + void g(const char*, ...) __attribute__((format(printf, 2, 3))); +}; diff --git a/clang/test/SemaCXX/class-base-member-init.cpp b/clang/test/SemaCXX/class-base-member-init.cpp index c38c3d3337e..2092847bc02 100644 --- a/clang/test/SemaCXX/class-base-member-init.cpp +++ b/clang/test/SemaCXX/class-base-member-init.cpp @@ -7,9 +7,9 @@ public: struct D : S { D() : b1(0), b2(1), b1(0), S(), S() {} // expected-error {{multiple initializations given for non-static member 'b1'}} \ - // expected-note {{previous initialization is here}} \ - // expected-error {{multiple initializations given for base 'class S'}} \ - // expected-note {{previous initialization is here}} + // expected-note {{previous initialization is here}} \ + // expected-error {{multiple initializations given for base 'class S'}} \ + // expected-note {{previous initialization is here}} int b1; int b2; diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp index 1a7787ee0ea..b86a27d66d9 100644 --- a/clang/test/SemaCXX/constructor-initializer.cpp +++ b/clang/test/SemaCXX/constructor-initializer.cpp @@ -94,18 +94,18 @@ struct Current : Derived { Derived::V(), // expected-note {{base 'Derived::V'}} ::NonExisting(), // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}} INT::NonExisting() {} // expected-error {{expected a class or namespace}} \ - // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}} + // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}} }; // FIXME. This is bad message! -struct M { // expected-note {{candidate function}} \ - // expected-note {{candidate function}} - M(int i, int j); // expected-note {{candidate function}} \ - // // expected-note {{candidate function}} +struct M { // expected-note {{candidate function}} \ + // expected-note {{candidate function}} + M(int i, int j); // expected-note {{candidate function}} \ + // // expected-note {{candidate function}} }; struct N : M { - N() : M(1), // expected-error {{no matching constructor for initialization of 'M'}} + N() : M(1), // expected-error {{no matching constructor for initialization of 'M'}} m1(100) { } // expected-error {{no matching constructor for initialization of 'm1'}} M m1; }; @@ -116,7 +116,7 @@ struct P : M { // expected-error {{default constructor for 'struct M' is missin }; struct Q { - Q() : f1(1,2), // expected-error {{Too many arguments for member initializer 'f1'}} + Q() : f1(1,2), // expected-error {{Too many arguments for member initializer 'f1'}} pf(0.0) { } // expected-error {{incompatible type passing 'double', expected 'float *'}} float f1; diff --git a/clang/test/SemaCXX/copy-constructor-error.cpp b/clang/test/SemaCXX/copy-constructor-error.cpp index afe741faa48..2e42fcc3b1c 100644 --- a/clang/test/SemaCXX/copy-constructor-error.cpp +++ b/clang/test/SemaCXX/copy-constructor-error.cpp @@ -1,8 +1,8 @@ // RUN: clang-cc -fsyntax-only -verify %s -struct S { // expected-note {{candidate function}} - S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\ - // expected-note {{candidate function}} +struct S { // expected-note {{candidate function}} + S (S); // expected-error {{copy constructor must pass its first argument by reference}} \\ + // expected-note {{candidate function}} }; S f(); diff --git a/clang/test/SemaCXX/default-assignment-operator.cpp b/clang/test/SemaCXX/default-assignment-operator.cpp index 64ea49837b7..e627fefdef6 100644 --- a/clang/test/SemaCXX/default-assignment-operator.cpp +++ b/clang/test/SemaCXX/default-assignment-operator.cpp @@ -26,7 +26,7 @@ Z z2; // Test1 void f(X x, const X cx) { - x = cx; // expected-note {{synthesized method is first required here}} + x = cx; // expected-note {{synthesized method is first required here}} x = cx; z1 = z2; } @@ -36,8 +36,7 @@ class T {}; T t1; T t2; -void g() -{ +void g() { t1 = t2; } @@ -51,8 +50,7 @@ public: class W : V {}; W w1, w2; -void h() -{ +void h() { w1 = w2; } @@ -67,9 +65,8 @@ public: class D1 : B1 {}; D1 d1, d2; -void i() -{ - d1 = d2; +void i() { + d1 = d2; } // Test5 @@ -83,8 +80,7 @@ public: E1 e1, e2; -void j() -{ +void j() { e1 = e2; // expected-note{{synthesized method is first required here}} } diff --git a/clang/test/SemaCXX/default-constructor-initializers.cpp b/clang/test/SemaCXX/default-constructor-initializers.cpp index 12149e55a7a..a6db6a7d9a4 100644 --- a/clang/test/SemaCXX/default-constructor-initializers.cpp +++ b/clang/test/SemaCXX/default-constructor-initializers.cpp @@ -46,9 +46,9 @@ Y4 y4; struct Z1 { - int& z; // expected-note {{declared at}} - const int c1; // expected-note {{declared at}} - volatile int v1; + int& z; // expected-note {{declared at}} + const int c1; // expected-note {{declared at}} + volatile int v1; }; Z1 z1; // expected-error {{cannot define the implicit default constructor for 'struct Z1', because reference member 'z' cannot be default-initialized}} \ diff --git a/clang/test/SemaCXX/enum.cpp b/clang/test/SemaCXX/enum.cpp index 9668c84693d..431f457259f 100644 --- a/clang/test/SemaCXX/enum.cpp +++ b/clang/test/SemaCXX/enum.cpp @@ -14,14 +14,13 @@ void f() { // <rdar://problem/6502934> typedef enum Foo { - A = 0, - B = 1 + A = 0, + B = 1 } Foo; - - + void bar() { - Foo myvar = A; - myvar = B; + Foo myvar = A; + myvar = B; } /// PR3688 diff --git a/clang/test/SemaCXX/illegal-member-initialization.cpp b/clang/test/SemaCXX/illegal-member-initialization.cpp index 8cedb6f73b6..2d7c73d68a3 100644 --- a/clang/test/SemaCXX/illegal-member-initialization.cpp +++ b/clang/test/SemaCXX/illegal-member-initialization.cpp @@ -3,7 +3,7 @@ struct A { A() : value(), cvalue() { } // expected-error {{cannot initialize the member to null in default constructor because reference member 'value' cannot be null-initialized}} \ // expected-error {{constructor for 'struct A' must explicitly initialize the reference member 'value'}} - int &value; // expected-note{{declared at}} {{expected-note{{declared at}} + int &value; // expected-note{{declared at}} {{expected-note{{declared at}} const int cvalue; }; @@ -11,10 +11,10 @@ struct B { }; struct X { - X() { } // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'value'}} \ - // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cvalue'}} \ - // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'b'}} \ - // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cb'}} + X() { } // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'value'}} \ + // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cvalue'}} \ + // expected-error {{constructor for 'struct X' must explicitly initialize the reference member 'b'}} \ + // expected-error {{constructor for 'struct X' must explicitly initialize the const member 'cb'}} int &value; // expected-note{{declared at}} const int cvalue; // expected-note{{declared at}} B& b; // expected-note{{declared at}} diff --git a/clang/test/SemaCXX/inherit.cpp b/clang/test/SemaCXX/inherit.cpp index eaad97cc82a..069e30d0cdf 100644 --- a/clang/test/SemaCXX/inherit.cpp +++ b/clang/test/SemaCXX/inherit.cpp @@ -10,7 +10,7 @@ class B3 : virtual virtual A { }; // expected-error{{duplicate 'virtual' in base class C : public B1, private B2 { }; -class D; // expected-note {{forward declaration of 'class D'}} +class D; // expected-note {{forward declaration of 'class D'}} class E : public D { }; // expected-error{{base class has incomplete type}} diff --git a/clang/test/SemaCXX/member-expr-static.cpp b/clang/test/SemaCXX/member-expr-static.cpp index b6495a85204..2fa7e0781c1 100644 --- a/clang/test/SemaCXX/member-expr-static.cpp +++ b/clang/test/SemaCXX/member-expr-static.cpp @@ -2,20 +2,18 @@ typedef void (*thread_continue_t)(); extern "C" { -extern void kernel_thread_start(thread_continue_t continuation); -extern void pure_c(void); + extern void kernel_thread_start(thread_continue_t continuation); + extern void pure_c(void); } -class _IOConfigThread -{ +class _IOConfigThread { public: - static void main( void ); + static void main( void ); }; -void foo( void ) -{ - kernel_thread_start(&_IOConfigThread::main); - kernel_thread_start((thread_continue_t)&_IOConfigThread::main); - kernel_thread_start(&pure_c); +void foo( void ) { + kernel_thread_start(&_IOConfigThread::main); + kernel_thread_start((thread_continue_t)&_IOConfigThread::main); + kernel_thread_start(&pure_c); } diff --git a/clang/test/SemaCXX/static-initializers.cpp b/clang/test/SemaCXX/static-initializers.cpp index 3d92a532ae1..a651243df7e 100644 --- a/clang/test/SemaCXX/static-initializers.cpp +++ b/clang/test/SemaCXX/static-initializers.cpp @@ -1,12 +1,10 @@ // RUN: clang-cc -fsyntax-only -verify %s -int f() -{ - return 10; +int f() { + return 10; } -void g() -{ - static int a = f(); +void g() { + static int a = f(); } static int b = f(); diff --git a/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp b/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp index a1990329ace..bfce588b570 100644 --- a/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp +++ b/clang/test/SemaCXX/warn-reorder-ctor-initialization.cpp @@ -64,13 +64,13 @@ struct B1 { }; struct F : public A1, public B1, private virtual V { - F() : A1(), V() { } // expected-warning {{base class 'struct A1' will be initialized after}} \ - // expected-note {{base 'struct V'}} + F() : A1(), V() { } // expected-warning {{base class 'struct A1' will be initialized after}} \ + // expected-note {{base 'struct V'}} }; struct X : public virtual A, virtual V, public virtual B { - X(): A(), V(), B() {} // expected-warning {{base class 'struct A' will be initialized after}} \ - // expected-note {{base 'struct V'}} + X(): A(), V(), B() {} // expected-warning {{base class 'struct A' will be initialized after}} \ + // expected-note {{base 'struct V'}} }; class Anon { |

