diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-09 20:53:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-09 20:53:38 +0000 |
commit | 3c7cd6a0c448bb5484f5f6c13cb0938d9e4d7768 (patch) | |
tree | d255d158d04a6e1bbf2b0dde7218da4b52316a72 /clang/test/Modules/module-private.cpp | |
parent | 4444daeec5650c75dbc3cfa9cf503a0ec27ebaf1 (diff) | |
download | bcm5719-llvm-3c7cd6a0c448bb5484f5f6c13cb0938d9e4d7768.tar.gz bcm5719-llvm-3c7cd6a0c448bb5484f5f6c13cb0938d9e4d7768.zip |
Specializations cannot be module-hidden. Diagnose attempts to do so.
llvm-svn: 139406
Diffstat (limited to 'clang/test/Modules/module-private.cpp')
-rw-r--r-- | clang/test/Modules/module-private.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Modules/module-private.cpp b/clang/test/Modules/module-private.cpp index 3ee59c8a9c1..0f1d5923dc4 100644 --- a/clang/test/Modules/module-private.cpp +++ b/clang/test/Modules/module-private.cpp @@ -88,5 +88,22 @@ __module_private__ void public_func_template(); // expected-error{{__module_priv 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}} +// Check for attempts to make specializations private +template<> __module_private__ void public_func_template<int>(); // expected-error{{template specialization cannot be declared __module_private__}} + +template<typename T> +struct public_class { + struct inner_struct; + static int static_var; +}; + +template<> __module_private__ struct public_class<int>::inner_struct { }; // expected-error{{member specialization cannot be declared __module_private__}} +template<> __module_private__ int public_class<int>::static_var = 17; // expected-error{{member specialization cannot be declared __module_private__}} + +template<> +__module_private__ struct public_class<float> { }; // expected-error{{template specialization cannot be declared __module_private__}} + +template<typename T> +__module_private__ struct public_class<T *> { }; // expected-error{{partial specialization cannot be declared __module_private__}} #endif |