[clang] NFC: remove trailing white spaces from some tests

Differential Revision: https://reviews.llvm.org/D99826
This commit is contained in:
Matheus Izvekov 2021-04-03 03:10:12 +02:00
parent c318746345
commit bac74a50e9
6 changed files with 47 additions and 47 deletions

View File

@ -1103,7 +1103,7 @@ namespace dr384 { // dr384: yes
}
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(); }

View File

@ -9,7 +9,7 @@ int &f = [] (int r) -> decltype(auto) { return r; } (a); // expected-error {{can
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 @@ int test_explicit_auto_return()
auto MPtr = [](auto c) -> auto* { return &c; }; //expected-warning{{address of stack}}
auto MDeclType = [](auto&& d) -> decltype(auto) { return static_cast<decltype(d)>(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,7 +60,7 @@ int test_no_parameter_list()
}
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.

View File

@ -22,7 +22,7 @@ void throw_move_only(X x) {
throw x;
throw x2;
}
namespace PR10142 {
struct X {
X();

View File

@ -1,15 +1,15 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {
struct A {
template <class T> operator T*();
};
};
template <class T> 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 @@ namespace PR5742 {
class Foo {
public:
template <typename T> operator T();
template <typename T>
T As() {
return this->operator T();
@ -43,7 +43,7 @@ class Foo {
T As2() {
return operator T();
}
int AsInt() {
return this->operator int();
}
@ -58,9 +58,9 @@ struct X0 {
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<typename T> operator T*() const; // expected-note{{explicit instantiation refers here}}
template<typename T> 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'}} \

View File

@ -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 @@ public:
// 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 @@ public:
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 @@ void f(const C& c) {
}
// 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 AutoPtrRef { };
class AutoPtr {
AutoPtr(AutoPtr &); // expected-note{{declared private here}}
public:
AutoPtr();
AutoPtr(AutoPtrRef);
operator AutoPtrRef();
};
@ -136,11 +136,11 @@ AutoPtr make_auto_ptr();
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 @@ namespace source_locations {
const A<float, int> &caf2 = E();
}
// Check
// Check
template<typename T>
struct E2 {
operator T
@ -212,7 +212,7 @@ namespace crazy_declarators {
}
namespace smart_ptr {
class Y {
class Y {
class YRef { };
Y(Y&);
@ -246,7 +246,7 @@ struct Any {
};
struct Other {
Other(const Other &);
Other(const Other &);
Other();
};
@ -289,7 +289,7 @@ namespace PR7055 {
struct Y {
Y(X);
};
Y f2(foo());
}
@ -339,7 +339,7 @@ namespace rdar8018274 {
struct Derived2 : Base { };
struct SuperDerived : Derived1, Derived2 {
struct SuperDerived : Derived1, Derived2 {
using Derived1::operator int;
};
@ -359,7 +359,7 @@ namespace rdar8018274 {
operator int();
};
struct Derived23 : Base2, Base3 {
struct Derived23 : Base2, Base3 {
using Base2::operator int;
};
@ -404,7 +404,7 @@ namespace PR9336 {
{
template<class Container>
operator Container()
{
{
Container ar;
T* i;
ar[0]=*i;

View File

@ -377,7 +377,7 @@ namespace MemberTemplatesWithDeduction {
return 5;
}
template<class T> operator T() { return T{}; }
operator auto() { return &static_foo<int>; }
operator auto() { return &static_foo<int>; }
};
struct N : M {
using M::foo;
@ -385,7 +385,7 @@ namespace MemberTemplatesWithDeduction {
using M::static_foo;
using M::operator auto;
};
template <class T> int test() {
int i = T{}.foo(3);
T m = T{}.foo(M{});
@ -400,7 +400,7 @@ namespace MemberTemplatesWithDeduction {
}
int Minst = test<M>();
int Ninst = test<N>();
}
}
@ -451,11 +451,11 @@ namespace CurrentInstantiation {
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<int>::g(); // expected-note {{in instantiation of}}
#else
template int U<int>::g();