// RUN: rm -rf %t
// RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fmodule-name=module_private_left -emit-module %S/Inputs/module.map
// RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -fmodule-name=module_private_right -emit-module %S/Inputs/module.map
// RUN: %clang_cc1 -std=c++17 -fmodules -fimplicit-module-maps -x objective-c++ -fmodules-cache-path=%t -I %S/Inputs %s -verify
// FIXME: When we have a syntax for modules in C++, use that.
@import module_private_left;
@import module_private_right;
void
int
// Check for private redeclarations of public entities.
;
__module_private__ class public_class_template;
typedef int public_typedef;
typedef __module_private__ int public_typedef;
extern int public_var;
extern __module_private__ int public_var;
void ;
__module_private__ void ;
void ;
__module_private__ void ;
;
__module_private__ struct public_struct;
// Check for attempts to make specializations private
__module_private__ void ; // expected-error{{template specialization cannot be declared __module_private__}}
;
__module_private__ struct public_class<int>::inner_struct ; // expected-error{{member specialization cannot be declared __module_private__}}
__module_private__ int public_class<int>::static_var = 17; // expected-error{{member specialization cannot be declared __module_private__}}
__module_private__ struct public_class<float> ; // expected-error{{template specialization cannot be declared __module_private__}}
__module_private__ struct public_class<T *> ; // expected-error{{partial specialization cannot be declared __module_private__}}
// Check for attempts to make parameters and variables with automatic
// storage module-private.
void
void // expected-error {{parameter '' cannot be declared __module_private}}
// Check struct size
;
int check_struct_size;