[cfe-commits] r139597 - /cfe/trunk/test/Modules/module-private.cpp

Douglas Gregor dgregor at apple.com
Tue Sep 13 08:37:05 PDT 2011


Author: dgregor
Date: Tue Sep 13 10:37:05 2011
New Revision: 139597

URL: http://llvm.org/viewvc/llvm-project?rev=139597&view=rev
Log:
Add a struct-size check for modules when dealing with module-private fields

Modified:
    cfe/trunk/test/Modules/module-private.cpp

Modified: cfe/trunk/test/Modules/module-private.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/module-private.cpp?rev=139597&r1=139596&r2=139597&view=diff
==============================================================================
--- cfe/trunk/test/Modules/module-private.cpp (original)
+++ cfe/trunk/test/Modules/module-private.cpp Tue Sep 13 10:37:05 2011
@@ -43,7 +43,7 @@
 
 struct VisibleStruct {
   __module_private__ int field;
-  __module_private__ void setField(int f);
+  __module_private__ virtual void setField(int f);
 };
 
 #else
@@ -129,4 +129,12 @@
 
   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





More information about the cfe-commits mailing list