Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sema] Check that the destructor for each element of class type is
accessible from the context where aggregate initialization occurs. rdar://problem/38168772 Differential Revision: https://reviews.llvm.org/D45898 llvm-svn: 341629
- Loading branch information
Showing
3 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.13.0 -std=c++1z -fobjc-arc -fobjc-exceptions -fcxx-exceptions -fexceptions -emit-llvm -o - %s | FileCheck %s | ||
|
||
// CHECK: %[[V0:.*]] = type opaque | ||
// CHECK: %[[STRUCT_CLASS1:.*]] = type { %[[V0]]* } | ||
|
||
@interface Class0; | ||
@end | ||
|
||
struct Class1 { | ||
Class0 *f; | ||
}; | ||
|
||
struct Container { | ||
Class1 a; | ||
bool b; | ||
}; | ||
|
||
bool getBool() { | ||
return false; | ||
} | ||
|
||
Class0 *g; | ||
|
||
// CHECK: define {{.*}} @_Z4testv() | ||
// CHECK: invoke zeroext i1 @_Z7getBoolv() | ||
// CHECK: landingpad { i8*, i32 } | ||
// CHECK: call void @_ZN6Class1D1Ev(%[[STRUCT_CLASS1]]* %{{.*}}) | ||
// CHECK: br label | ||
|
||
// CHECK: define linkonce_odr void @_ZN6Class1D1Ev( | ||
|
||
Container test() { | ||
return {{g}, getBool()}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters