summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/microsoft-dtor-lookup.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-01-13 17:23:24 +0000
committerHans Wennborg <hans@hanshq.net>2014-01-13 17:23:24 +0000
commit0f3c10cb8a3b54b95077eb980358a11448d84d1e (patch)
tree086da72711f0c8a592efb30c05fdbe505d5bc380 /clang/test/SemaCXX/microsoft-dtor-lookup.cpp
parent9bc0415c1fd937bdbc7d87bb7486b83c0aab32c9 (diff)
downloadbcm5719-llvm-0f3c10cb8a3b54b95077eb980358a11448d84d1e.tar.gz
bcm5719-llvm-0f3c10cb8a3b54b95077eb980358a11448d84d1e.zip
[ms-cxxabi] Elide dtor access checks for pass-by-val objects in callees
The ABI requires the destructor to be invoked in the callee, but the standard does not require access checks here so we avoid doing direct access checks on the destructor. If we end up needing to define an implicit destructor, we don't skip access checks for the base class, etc. Those checks are effectively part of generating the destructor definition, and aren't affected by which TU the check is performed in. Differential Revision: http://llvm-reviews.chandlerc.com/D2409 llvm-svn: 199120
Diffstat (limited to 'clang/test/SemaCXX/microsoft-dtor-lookup.cpp')
-rw-r--r--clang/test/SemaCXX/microsoft-dtor-lookup.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/test/SemaCXX/microsoft-dtor-lookup.cpp b/clang/test/SemaCXX/microsoft-dtor-lookup.cpp
index d264bab09bf..a25ede6d6e8 100644
--- a/clang/test/SemaCXX/microsoft-dtor-lookup.cpp
+++ b/clang/test/SemaCXX/microsoft-dtor-lookup.cpp
@@ -32,10 +32,9 @@ namespace Test2 {
// requires a dtor for B, but we can't implicitly define it because ~A is
// private. bar should be able to call A's private dtor without error, even
// though MSVC rejects bar.
-
class A {
private:
- ~A(); // expected-note 2{{declared private here}}
+ ~A(); // expected-note {{declared private here}}
int a;
};
@@ -54,7 +53,7 @@ struct D {
};
void foo(B b) { } // expected-note {{implicit destructor for 'Test2::B' first required here}}
-void bar(A a) { } // expected-error {{variable of type 'Test2::A' has private destructor}}
+void bar(A a) { } // no error; MSVC rejects this, but we skip the direct access check.
void baz(D d) { } // no error
}
@@ -64,13 +63,13 @@ namespace Test3 {
class A {
A();
- ~A(); // expected-note 2{{implicitly declared private here}}
+ ~A(); // expected-note {{implicitly declared private here}}
friend void bar(A);
int a;
};
void bar(A a) { }
-void baz(A a) { } // expected-error {{variable of type 'Test3::A' has private destructor}}
+void baz(A a) { } // no error; MSVC rejects this, but the standard allows it.
// MSVC accepts foo() but we reject it for consistency with Itanium. MSVC also
// rejects this if A has a copy ctor or if we call A's ctor.
OpenPOWER on IntegriCloud