forked from OSchip/llvm-project
Fix some confusing diagnostic wording. s/implicit default/implicit/ if we're
not actually talking about a default constructor. llvm-svn: 183885
This commit is contained in:
parent
d577fbbd1c
commit
f24e6e747b
|
@ -1138,7 +1138,7 @@ def note_bitfield_decl : Note<"bit-field is declared here">;
|
|||
def note_previous_decl : Note<"%0 declared here">;
|
||||
def note_implicit_param_decl : Note<"%0 is an implicit parameter">;
|
||||
def note_member_synthesized_at : Note<
|
||||
"implicit default %select{constructor|copy constructor|move constructor|copy "
|
||||
"implicit %select{default constructor|copy constructor|move constructor|copy "
|
||||
"assignment operator|move assignment operator|destructor}0 for %1 first "
|
||||
"required here">;
|
||||
def note_inhctor_synthesized_at : Note<
|
||||
|
@ -2407,8 +2407,8 @@ def err_param_default_argument_member_template_redecl : Error<
|
|||
"of a %select{class template|class template partial specialization|nested "
|
||||
"class in a template}0">;
|
||||
def err_uninitialized_member_for_assign : Error<
|
||||
"cannot define the implicit default assignment operator for %0, because "
|
||||
"non-static %select{reference|const}1 member %2 can't use default "
|
||||
"cannot define the implicit copy assignment operator for %0, because "
|
||||
"non-static %select{reference|const}1 member %2 can't use copy "
|
||||
"assignment operator">;
|
||||
def err_uninitialized_member_in_ctor : Error<
|
||||
"%select{|implicit default |inheriting }0constructor for %1 must explicitly "
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace test3 {
|
|||
virtual Base3
|
||||
{};
|
||||
Derived3 d3; // expected-note {{implicit default constructor}}\
|
||||
// expected-note{{implicit default destructor}}}
|
||||
// expected-note{{implicit destructor}}}
|
||||
}
|
||||
|
||||
// Conversion functions.
|
||||
|
@ -207,13 +207,13 @@ namespace test5 {
|
|||
class Test1 { A a; }; // expected-error {{private member}}
|
||||
void test1() {
|
||||
Test1 a;
|
||||
a = Test1(); // expected-note{{implicit default copy}}
|
||||
a = Test1(); // expected-note{{implicit copy}}
|
||||
}
|
||||
|
||||
class Test2 : A {}; // expected-error {{private member}}
|
||||
void test2() {
|
||||
Test2 a;
|
||||
a = Test2(); // expected-note{{implicit default copy}}
|
||||
a = Test2(); // expected-note{{implicit copy}}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,12 +226,12 @@ namespace test6 {
|
|||
|
||||
class Test1 { A a; }; // expected-error {{field of type 'test6::A' has private copy constructor}}
|
||||
void test1(const Test1 &t) {
|
||||
Test1 a = t; // expected-note{{implicit default copy}}
|
||||
Test1 a = t; // expected-note{{implicit copy}}
|
||||
}
|
||||
|
||||
class Test2 : A {}; // expected-error {{base class 'test6::A' has private copy constructor}}
|
||||
void test2(const Test2 &t) {
|
||||
Test2 a = t; // expected-note{{implicit default copy}}
|
||||
Test2 a = t; // expected-note{{implicit copy}}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace dr7 { // dr7: yes
|
|||
class B : virtual private A {}; // expected-note 2 {{declared private here}}
|
||||
class C : public B {} c; // expected-error 2 {{inherited virtual base class 'dr7::A' has private destructor}} \
|
||||
// expected-note {{implicit default constructor for 'dr7::C' first required here}} \
|
||||
// expected-note {{implicit default destructor for 'dr7::C' first required here}}
|
||||
// expected-note {{implicit destructor for 'dr7::C' first required here}}
|
||||
class VeryDerivedC : public B, virtual public A {} vdc;
|
||||
|
||||
class X { ~X(); }; // expected-note {{here}}
|
||||
|
|
|
@ -7,7 +7,7 @@ struct Foo : public Base { // expected-error {{base class 'Base' has private des
|
|||
Foo();
|
||||
};
|
||||
struct Bar : public Foo {
|
||||
Bar() { } // expected-note {{implicit default destructor for 'Foo' first required here}}
|
||||
Bar() { } // expected-note {{implicit destructor for 'Foo' first required here}}
|
||||
};
|
||||
struct Baz {
|
||||
Foo f;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
class Base { // expected-error {{cannot define the implicit default assignment operator for 'Base', because non-static reference member 'ref' can't use default assignment operator}} \
|
||||
class Base { // expected-error {{cannot define the implicit copy assignment operator for 'Base', because non-static reference member 'ref' can't use copy assignment operator}} \
|
||||
// expected-warning{{class 'Base' does not declare any constructor to initialize its non-modifiable members}}
|
||||
int &ref; // expected-note {{declared here}} \
|
||||
// expected-note{{reference member 'ref' will never be initialized}}
|
||||
};
|
||||
|
||||
class X : Base { // // expected-error {{cannot define the implicit default assignment operator for 'X', because non-static const member 'cint' can't use default assignment operator}} \
|
||||
class X : Base { // // expected-error {{cannot define the implicit copy assignment operator for 'X', because non-static const member 'cint' can't use copy assignment operator}} \
|
||||
// expected-note{{assignment operator for 'Base' first required here}}
|
||||
public:
|
||||
X();
|
||||
|
@ -73,7 +73,7 @@ void i() {
|
|||
|
||||
// Test5
|
||||
|
||||
class E1 { // expected-error{{cannot define the implicit default assignment operator for 'E1', because non-static const member 'a' can't use default assignment operator}}
|
||||
class E1 { // expected-error{{cannot define the implicit copy assignment operator for 'E1', because non-static const member 'a' can't use copy assignment operator}}
|
||||
|
||||
public:
|
||||
const int a; // expected-note{{declared here}}
|
||||
|
@ -101,7 +101,7 @@ namespace ProtectedCheck {
|
|||
X x;
|
||||
};
|
||||
|
||||
void f(Z z) { z = z; } // expected-note{{implicit default copy assignment operator}}
|
||||
void f(Z z) { z = z; } // expected-note{{implicit copy assignment operator}}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -39,21 +39,21 @@ namespace DeprecatedCopy {
|
|||
struct Assign {
|
||||
Assign &operator=(const Assign&); // expected-warning {{definition of implicit copy constructor for 'Assign' is deprecated because it has a user-declared copy assignment operator}}
|
||||
};
|
||||
Assign a1, a2(a1); // expected-note {{implicit default copy constructor for 'Assign' first required here}}
|
||||
Assign a1, a2(a1); // expected-note {{implicit copy constructor for 'Assign' first required here}}
|
||||
|
||||
struct Ctor {
|
||||
Ctor();
|
||||
Ctor(const Ctor&); // expected-warning {{definition of implicit copy assignment operator for 'Ctor' is deprecated because it has a user-declared copy constructor}}
|
||||
};
|
||||
Ctor b1, b2;
|
||||
void f() { b1 = b2; } // expected-note {{implicit default copy assignment operator for 'Ctor' first required here}}
|
||||
void f() { b1 = b2; } // expected-note {{implicit copy assignment operator for 'Ctor' first required here}}
|
||||
|
||||
struct Dtor {
|
||||
~Dtor();
|
||||
// expected-warning@-1 {{definition of implicit copy constructor for 'Dtor' is deprecated because it has a user-declared destructor}}
|
||||
// expected-warning@-2 {{definition of implicit copy assignment operator for 'Dtor' is deprecated because it has a user-declared destructor}}
|
||||
};
|
||||
Dtor c1, c2(c1); // expected-note {{implicit default copy constructor for 'Dtor' first required here}}
|
||||
void g() { c1 = c2; } // expected-note {{implicit default copy assignment operator for 'Dtor' first required here}}
|
||||
Dtor c1, c2(c1); // expected-note {{implicit copy constructor for 'Dtor' first required here}}
|
||||
void g() { c1 = c2; } // expected-note {{implicit copy assignment operator for 'Dtor' first required here}}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -9,7 +9,7 @@ struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
|
|||
void operator delete (void *, int); // expected-note {{'operator delete' declared here}}
|
||||
};
|
||||
|
||||
void B::f() { // expected-note {{implicit default destructor for 'B' first required here}}
|
||||
void B::f() { // expected-note {{implicit destructor for 'B' first required here}}
|
||||
}
|
||||
|
||||
struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
|
||||
|
@ -17,13 +17,13 @@ struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}}
|
|||
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
|
||||
};
|
||||
|
||||
C::C() { } // expected-note {{implicit default destructor for 'C' first required here}}
|
||||
C::C() { } // expected-note {{implicit destructor for 'C' first required here}}
|
||||
|
||||
struct D : A { // expected-error {{no suitable member 'operator delete' in 'D'}}
|
||||
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
|
||||
};
|
||||
|
||||
void f() {
|
||||
new D; // expected-note {{implicit default destructor for 'D' first required here}}
|
||||
new D; // expected-note {{implicit destructor for 'D' first required here}}
|
||||
}
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ struct X11 : X10 { // expected-error {{no suitable member 'operator delete' in '
|
|||
};
|
||||
|
||||
void f() {
|
||||
X11 x11; // expected-note {{implicit default destructor for 'X11' first required here}}
|
||||
X11 x11; // expected-note {{implicit destructor for 'X11' first required here}}
|
||||
}
|
||||
|
||||
struct X12 {
|
||||
|
@ -394,7 +394,7 @@ namespace ArrayNewNeedsDtor {
|
|||
struct A { A(); private: ~A(); }; // expected-note {{declared private here}}
|
||||
struct B { B(); A a; }; // expected-error {{field of type 'ArrayNewNeedsDtor::A' has private destructor}}
|
||||
B *test9() {
|
||||
return new B[5]; // expected-note {{implicit default destructor for 'ArrayNewNeedsDtor::B' first required here}}
|
||||
return new B[5]; // expected-note {{implicit destructor for 'ArrayNewNeedsDtor::B' first required here}}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,19 +13,19 @@ struct D : public virtual B {
|
|||
virtual void foo();
|
||||
~D();
|
||||
};
|
||||
void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
|
||||
void D::foo() { // expected-note {{implicit destructor for 'B' first required here}}
|
||||
}
|
||||
|
||||
struct E : public virtual A {
|
||||
NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
|
||||
};
|
||||
struct F : public E { // expected-note {{implicit default destructor for 'E' first required here}}
|
||||
struct F : public E { // expected-note {{implicit destructor for 'E' first required here}}
|
||||
};
|
||||
struct G : public virtual F {
|
||||
virtual void foo();
|
||||
~G();
|
||||
};
|
||||
void G::foo() { // expected-note {{implicit default destructor for 'F' first required here}}
|
||||
void G::foo() { // expected-note {{implicit destructor for 'F' first required here}}
|
||||
}
|
||||
|
||||
struct H : public virtual A {
|
||||
|
@ -38,5 +38,5 @@ struct J : public I {
|
|||
virtual void foo();
|
||||
~J();
|
||||
};
|
||||
void J::foo() { // expected-note {{implicit default destructor for 'H' first required here}}
|
||||
void J::foo() { // expected-note {{implicit destructor for 'H' first required here}}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ struct A {
|
|||
};
|
||||
|
||||
struct B : A { // expected-error {{no suitable member 'operator delete' in 'B'}}
|
||||
B() { } // expected-note {{implicit default destructor for 'B' first required here}}
|
||||
B() { } // expected-note {{implicit destructor for 'B' first required here}}
|
||||
void operator delete(void *, int); // expected-note {{'operator delete' declared here}}
|
||||
};
|
||||
|
||||
|
@ -14,7 +14,7 @@ struct C : A { // expected-error {{no suitable member 'operator delete' in 'C'}
|
|||
|
||||
void f() {
|
||||
(void)new B;
|
||||
(void)new C; // expected-note {{implicit default destructor for 'C' first required here}}
|
||||
(void)new C; // expected-note {{implicit destructor for 'C' first required here}}
|
||||
}
|
||||
|
||||
// Make sure that the key-function computation is consistent when the
|
||||
|
|
|
@ -12,7 +12,7 @@ struct X : T { }; // expected-error 2{{private destructor}}
|
|||
struct Z; // expected-note{{forward declaration}}
|
||||
|
||||
@interface A {
|
||||
X<Y> x; // expected-note{{implicit default destructor}}
|
||||
X<Y> x; // expected-note{{implicit destructor}}
|
||||
Y y; // expected-error{{private destructor}}
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace PR7114 {
|
|||
int f() { return B<int>::value; }
|
||||
|
||||
void test_typeid(B<float>::Inner bfi) {
|
||||
(void)typeid(bfi); // expected-note{{implicit default destructor}}
|
||||
(void)typeid(bfi); // expected-note{{implicit destructor}}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Reference in New Issue