diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-07-14 02:01:48 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-07-14 02:01:48 +0000 |
commit | 42713d763f052def9d0b525da9530ac97333752c (patch) | |
tree | 87d36bbb63a906ba00ef99bfb9db03649cb76244 /clang/test | |
parent | a76289aa1bfde6abec629a94dc3d1d6e192e9d6f (diff) | |
download | bcm5719-llvm-42713d763f052def9d0b525da9530ac97333752c.tar.gz bcm5719-llvm-42713d763f052def9d0b525da9530ac97333752c.zip |
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.
llvm-svn: 186270
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Modules/Inputs/cxx-decls-imported.h | 0 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/cxx-decls-unimported.h | 1 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/module.map | 9 | ||||
-rw-r--r-- | clang/test/Modules/cxx-decls.cpp | 12 |
4 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/cxx-decls-imported.h b/clang/test/Modules/Inputs/cxx-decls-imported.h new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/clang/test/Modules/Inputs/cxx-decls-imported.h diff --git a/clang/test/Modules/Inputs/cxx-decls-unimported.h b/clang/test/Modules/Inputs/cxx-decls-unimported.h new file mode 100644 index 00000000000..0431e324616 --- /dev/null +++ b/clang/test/Modules/Inputs/cxx-decls-unimported.h @@ -0,0 +1 @@ +void operator delete(void*); diff --git a/clang/test/Modules/Inputs/module.map b/clang/test/Modules/Inputs/module.map index a4ac5b14de3..0a84f88b0af 100644 --- a/clang/test/Modules/Inputs/module.map +++ b/clang/test/Modules/Inputs/module.map @@ -200,6 +200,15 @@ module cxx_templates_b { header "cxx-templates-b.h" } +module cxx_decls { + module unimported { + header "cxx-decls-unimported.h" + } + module imported { + header "cxx-decls-imported.h" + } +} + module config { header "config.h" config_macros [exhaustive] WANT_FOO, WANT_BAR diff --git a/clang/test/Modules/cxx-decls.cpp b/clang/test/Modules/cxx-decls.cpp new file mode 100644 index 00000000000..733e3f90bc7 --- /dev/null +++ b/clang/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; +} |