diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-09 19:05:14 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-09 19:05:14 +0000 |
commit | e761230ae3751b525cadd8066c74ec278ee4ef57 (patch) | |
tree | 459e36d24abbe4c0680f2795203885991b4a6eb6 /test/Modules/module-private.cpp | |
parent | 9134294114c15b938f2ff954995d9f00f63dd9d8 (diff) |
__module_private__ is inherited by redeclarations of an entity, and
must also be present of the first declaration of that entity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Modules/module-private.cpp')
-rw-r--r-- | test/Modules/module-private.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Modules/module-private.cpp b/test/Modules/module-private.cpp index 689abd746a..3ee59c8a9c 100644 --- a/test/Modules/module-private.cpp +++ b/test/Modules/module-private.cpp @@ -63,4 +63,30 @@ int test_broken() { return hidden_var; // expected-error{{use of undeclared identifier 'hidden_var'}} } +// Check for private redeclarations of public entities. +template<typename T> +class public_class_template; // expected-note{{previous declaration is here}} + +template<typename T> +__module_private__ class public_class_template; // expected-error{{__module_private__ declaration of 'public_class_template' follows public declaration}} + + +typedef int public_typedef; // expected-note{{previous declaration is here}} +typedef __module_private__ int public_typedef; // expected-error{{__module_private__ declaration of 'public_typedef' follows public declaration}} + +extern int public_var; // expected-note{{previous declaration is here}} +extern __module_private__ int public_var; // expected-error{{__module_private__ declaration of 'public_var' follows public declaration}} + +void public_func(); // expected-note{{previous declaration is here}} +__module_private__ void public_func(); // expected-error{{__module_private__ declaration of 'public_func' follows public declaration}} + +template<typename T> +void public_func_template(); // expected-note{{previous declaration is here}} +template<typename T> +__module_private__ void public_func_template(); // expected-error{{__module_private__ declaration of 'public_func_template' follows public declaration}} + +struct public_struct; // expected-note{{previous declaration is here}} +__module_private__ struct public_struct; // expected-error{{__module_private__ declaration of 'public_struct' follows public declaration}} + + #endif |