diff --git a/clang/test/CXX/drs/dr3xx.cpp b/clang/test/CXX/drs/dr3xx.cpp --- a/clang/test/CXX/drs/dr3xx.cpp +++ b/clang/test/CXX/drs/dr3xx.cpp @@ -1103,7 +1103,7 @@ } namespace dr385 { // dr385: yes - struct A { protected: void f(); }; + struct A { protected: void f(); }; struct B : A { using A::f; }; struct C : A { void g(B b) { b.f(); } }; void h(B b) { b.f(); } diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p4-1y.cpp @@ -9,7 +9,7 @@ int &g = [] (int r) -> decltype(auto) { return (r); } (a); // expected-warning {{reference to stack}} -int test_explicit_auto_return() +int test_explicit_auto_return() { struct X {}; auto L = [](auto F, auto a) { return F(a); }; @@ -18,32 +18,32 @@ auto MPtr = [](auto c) -> auto* { return &c; }; //expected-warning{{address of stack}} auto MDeclType = [](auto&& d) -> decltype(auto) { return static_cast(d); }; //OK M(3); - + auto &&x = MDeclType(X{}); auto &&x1 = M(X{}); auto &&x2 = MRef(X{});//expected-note{{in instantiation of}} auto &&x3 = MPtr(X{}); //expected-note{{in instantiation of}} - return 0; + return 0; } -int test_implicit_auto_return() -{ +int test_implicit_auto_return() +{ { auto M = [](auto a) { return a; }; struct X {}; X x = M(X{}); - + } } - + int test_multiple_returns() { - auto M = [](auto a) { + auto M = [](auto a) { bool k; if (k) return a; else return 5; //expected-error{{deduced as 'int' here}} - }; + }; M(3); // OK M('a'); //expected-note{{in instantiation of}} return 0; @@ -60,10 +60,10 @@ } int test_conditional_in_return() { - auto Fac = [](auto f, auto n) { + auto Fac = [](auto f, auto n) { return n <= 0 ? n : f(f, n - 1) * n; }; // FIXME: this test causes a recursive limit - need to error more gracefully. //Fac(Fac, 3); } \ No newline at end of file diff --git a/clang/test/CXX/special/class.copy/p33-0x.cpp b/clang/test/CXX/special/class.copy/p33-0x.cpp --- a/clang/test/CXX/special/class.copy/p33-0x.cpp +++ b/clang/test/CXX/special/class.copy/p33-0x.cpp @@ -22,7 +22,7 @@ throw x; throw x2; } - + namespace PR10142 { struct X { X(); diff --git a/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp b/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp --- a/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp @@ -1,15 +1,15 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -struct A { +struct A { template operator T*(); -}; +}; template A::operator T*() { return 0; } template <> A::operator char*(){ return 0; } // specialization template A::operator void*(); // explicit instantiation -int main() { +int main() { A a; - int *ip; + int *ip; ip = a.operator int*(); } @@ -33,7 +33,7 @@ class Foo { public: template operator T(); - + template T As() { return this->operator T(); @@ -43,7 +43,7 @@ T As2() { return operator T(); } - + int AsInt() { return this->operator int(); } @@ -58,9 +58,9 @@ T x = 1; // expected-note{{variable 'x' declared const here}} x = 17; // expected-error{{cannot assign to variable 'x' with const-qualified type 'const int'}} } - + template operator T*() const; // expected-note{{explicit instantiation refers here}} - + template operator const T*() const { T x = T(); return x; // expected-error{{cannot initialize return object of type 'const char *' with an lvalue of type 'char'}} \ diff --git a/clang/test/SemaCXX/conversion-function.cpp b/clang/test/SemaCXX/conversion-function.cpp --- a/clang/test/SemaCXX/conversion-function.cpp +++ b/clang/test/SemaCXX/conversion-function.cpp @@ -1,8 +1,8 @@ -// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wbind-to-temporary-copy -verify %s +// RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wbind-to-temporary-copy -verify %s // RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wbind-to-temporary-copy -verify -std=c++98 %s // RUN: %clang_cc1 -triple %itanium_abi_triple -fsyntax-only -Wbind-to-temporary-copy -verify -std=c++11 %s -class X { +class X { public: operator bool(); operator int() const; @@ -31,11 +31,11 @@ // expected-error{{conversion function cannot have any parameters}} operator bool(int a = 4, int b = 6) const; // expected-error{{conversion function cannot have any parameters}} - - + + operator float(...) const; // expected-error{{conversion function cannot be variadic}} - - + + operator func_type(); // expected-error{{conversion function cannot convert to a function type}} operator array_type(); // expected-error{{conversion function cannot convert to an array type}} }; @@ -44,10 +44,10 @@ typedef int INT; typedef INT* INT_PTR; -class Z { +class Z { operator int(); // expected-note {{previous declaration is here}} operator int**(); // expected-note {{previous declaration is here}} - + operator INT(); // expected-error{{conversion function cannot be redeclared}} operator INT_PTR*(); // expected-error{{conversion function cannot be redeclared}} }; @@ -103,12 +103,12 @@ } // Test. Conversion in base class is visible in derived class. -class XB { +class XB { public: operator int(); // expected-note {{candidate function}} }; -class Yb : public XB { +class Yb : public XB { public: operator char(); // expected-note {{candidate function}} }; @@ -124,11 +124,11 @@ class AutoPtr { AutoPtr(AutoPtr &); // expected-note{{declared private here}} - + public: AutoPtr(); AutoPtr(AutoPtrRef); - + operator AutoPtrRef(); }; @@ -136,11 +136,11 @@ AutoPtr test_auto_ptr(bool Cond) { AutoPtr p1( make_auto_ptr() ); - + AutoPtr p; if (Cond) return p; // expected-error{{calling a private constructor}} - + return AutoPtr(); } @@ -185,7 +185,7 @@ const A &caf2 = E(); } - // Check + // Check template struct E2 { operator T @@ -212,7 +212,7 @@ } namespace smart_ptr { - class Y { + class Y { class YRef { }; Y(Y&); @@ -246,7 +246,7 @@ }; struct Other { - Other(const Other &); + Other(const Other &); Other(); }; @@ -289,7 +289,7 @@ struct Y { Y(X); }; - + Y f2(foo()); } @@ -339,7 +339,7 @@ struct Derived2 : Base { }; - struct SuperDerived : Derived1, Derived2 { + struct SuperDerived : Derived1, Derived2 { using Derived1::operator int; }; @@ -359,7 +359,7 @@ operator int(); }; - struct Derived23 : Base2, Base3 { + struct Derived23 : Base2, Base3 { using Base2::operator int; }; @@ -404,7 +404,7 @@ { template operator Container() - { + { Container ar; T* i; ar[0]=*i; diff --git a/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp b/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp --- a/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp +++ b/clang/test/SemaCXX/cxx1y-deduced-return-type.cpp @@ -377,7 +377,7 @@ return 5; } template operator T() { return T{}; } - operator auto() { return &static_foo; } + operator auto() { return &static_foo; } }; struct N : M { using M::foo; @@ -385,7 +385,7 @@ using M::static_foo; using M::operator auto; }; - + template int test() { int i = T{}.foo(3); T m = T{}.foo(M{}); @@ -400,7 +400,7 @@ } int Minst = test(); int Ninst = test(); - + } } @@ -451,11 +451,11 @@ auto f(); // expected-note {{here}} int g() { return f(); } // expected-error {{cannot be used before it is defined}} #else - auto f(); - int g() { return f(); } + auto f(); + int g() { return f(); } #endif }; - #ifndef DELAYED_TEMPLATE_PARSING + #ifndef DELAYED_TEMPLATE_PARSING template int U::g(); // expected-note {{in instantiation of}} #else template int U::g();