If an unimported submodule of an imported module contains a declaration of a
global allocation or deallocation function, that should not cause that global
allocation or deallocation function to become unavailable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186270 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Modules/cxx-decls.cpp b/test/Modules/cxx-decls.cpp
new file mode 100644
index 0000000..733e3f9
--- /dev/null
+++ b/test/Modules/cxx-decls.cpp
@@ -0,0 +1,12 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -x objective-c++ -fmodules -fmodules-cache-path=%t -I %S/Inputs %s -verify -std=c++11
+
+// expected-no-diagnostics
+
+@import cxx_decls.imported;
+
+void test_delete(int *p) {
+ // We can call the normal global deallocation function even though it has only
+ // ever been explicitly declared in an unimported submodule.
+ delete p;
+}