summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/DiagnosticParseKinds.td2
-rw-r--r--clang/lib/Sema/DeclSpec.cpp7
-rw-r--r--clang/test/Modules/module-private.cpp4
3 files changed, 2 insertions, 11 deletions
diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td
index 2c8a566719e..0f3b998c653 100644
--- a/clang/include/clang/Basic/DiagnosticParseKinds.td
+++ b/clang/include/clang/Basic/DiagnosticParseKinds.td
@@ -582,8 +582,6 @@ def err_module_expected_ident : Error<
"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
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 531e7a535a3..bb483cc9b10 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -899,13 +899,6 @@ void DeclSpec::Finish(Diagnostic &D, Preprocessor &PP) {
ClearStorageClassSpecs();
}
- // 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.
diff --git a/clang/test/Modules/module-private.cpp b/clang/test/Modules/module-private.cpp
index 849897f7333..44215386226 100644
--- a/clang/test/Modules/module-private.cpp
+++ b/clang/test/Modules/module-private.cpp
@@ -96,8 +96,8 @@ 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__}}
+ friend __module_private__ void public_func_friend();
+ friend __module_private__ struct public_struct_friend;
};
template<> __module_private__ struct public_class<int>::inner_struct { }; // expected-error{{member specialization cannot be declared __module_private__}}
OpenPOWER on IntegriCloud