From: Douglas Gregor Date: Tue, 13 Sep 2011 15:37:05 +0000 (+0000) Subject: Add a struct-size check for modules when dealing with module-private fields X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe522c20516878927e4f90a2aeafeeba2ea31c71;p=clang Add a struct-size check for modules when dealing with module-private fields git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139597 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Modules/module-private.cpp b/test/Modules/module-private.cpp index 539e591e09..81b2aca3fb 100644 --- a/test/Modules/module-private.cpp +++ b/test/Modules/module-private.cpp @@ -43,7 +43,7 @@ inline void test_f0_in_right() { struct VisibleStruct { __module_private__ int field; - __module_private__ void setField(int f); + __module_private__ virtual void setField(int f); }; #else @@ -129,4 +129,12 @@ void local_var_private(__module_private__ int param) { // expected-error{{parame typedef __module_private__ int local_typedef; // expected-error{{typedef 'local_typedef' cannot be declared __module_private__}} } + +// Check struct size +struct LikeVisibleStruct { + int field; + virtual void setField(int f); +}; + +int check_struct_size[sizeof(VisibleStruct) == sizeof(LikeVisibleStruct)? 1 : -1]; #endif