Ted pointed out that this test case could be using access control instead of

__attribute__((unavailable)).  I've done so, but unfortunately there's still a case
of redundant diagnostics.

llvm-svn: 109192
This commit is contained in:
John McCall 2010-07-22 22:44:38 +00:00
parent c67764eb4b
commit 7b5f0fe686
1 changed files with 5 additions and 6 deletions

View File

@ -97,9 +97,7 @@ void f(Yb& a) {
class AutoPtrRef { };
class AutoPtr {
// FIXME: Using 'unavailable' since we do not have access control yet.
// FIXME: The error message isn't so good.
AutoPtr(AutoPtr &) __attribute__((unavailable)); // expected-note{{explicitly marked}}
AutoPtr(AutoPtr &); // expected-note{{declared private here}}
public:
AutoPtr();
@ -115,7 +113,7 @@ AutoPtr test_auto_ptr(bool Cond) {
AutoPtr p;
if (Cond)
return p; // expected-error{{call to deleted constructor}}
return p; // expected-error{{calling a private constructor}}
return AutoPtr();
}
@ -125,11 +123,12 @@ struct A1 {
~A1();
private:
A1(const A1&) __attribute__((unavailable)); // expected-note{{here}}
A1(const A1&); // expected-note 2 {{declared private here}}
};
A1 f() {
return "Hello"; // expected-error{{invokes deleted constructor}}
// FIXME: redundant diagnostics!
return "Hello"; // expected-error {{calling a private constructor}} expected-warning {{an accessible copy constructor}}
}
namespace source_locations {