"expected a module name after '__import_module__'">;
def err_module_expected_semi : Error<
"expected a semicolon name after module name">;
+def err_module_private_friend : Error<
+ "friend cannot be declared __module_private__">;
}
} // end of Parser diagnostics
ClearStorageClassSpecs();
}
- assert(!TypeSpecOwned || isDeclRep((TST) TypeSpecType));
+ // A friend cannot be specified as module-private.
+ if (isFriendSpecified() && isModulePrivateSpecified()) {
+ Diag(D, ModulePrivateLoc, diag::err_module_private_friend)
+ << FixItHint::CreateRemoval(ModulePrivateLoc);
+ ModulePrivateLoc = SourceLocation();
+ }
+ assert(!TypeSpecOwned || isDeclRep((TST) TypeSpecType));
+
// Okay, now we can infer the real type.
// TODO: return "auto function" and other bad things based on the real type.
struct public_class {
struct inner_struct;
static int static_var;
+
+ friend __module_private__ void public_func(); // expected-error{{friend cannot be declared __module_private__}}
+ friend __module_private__ struct public_struct; // expected-error{{friend cannot be declared __module_private__}}
};
template<> __module_private__ struct public_class<int>::inner_struct { }; // expected-error{{member specialization cannot be declared __module_private__}}