From 4b3e7388d1a90f3e20a90d5624fe54dccca2610f Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 11 Oct 2016 13:57:36 +0000 Subject: [modules] PR28752: Do not instantiate variable declarations which are not visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith! llvm-svn: 283882 --- clang/test/Modules/Inputs/PR28752/Subdir1/b.h | 1 + clang/test/Modules/Inputs/PR28752/Subdir1/c.h | 0 .../Inputs/PR28752/Subdir1/module.modulemap | 5 ++++ clang/test/Modules/Inputs/PR28752/a.h | 1 + clang/test/Modules/Inputs/PR28752/module.modulemap | 1 + clang/test/Modules/Inputs/PR28752/vector | 28 ++++++++++++++++++++++ 6 files changed, 36 insertions(+) create mode 100644 clang/test/Modules/Inputs/PR28752/Subdir1/b.h create mode 100644 clang/test/Modules/Inputs/PR28752/Subdir1/c.h create mode 100644 clang/test/Modules/Inputs/PR28752/Subdir1/module.modulemap create mode 100644 clang/test/Modules/Inputs/PR28752/a.h create mode 100644 clang/test/Modules/Inputs/PR28752/module.modulemap create mode 100644 clang/test/Modules/Inputs/PR28752/vector (limited to 'clang/test/Modules/Inputs') diff --git a/clang/test/Modules/Inputs/PR28752/Subdir1/b.h b/clang/test/Modules/Inputs/PR28752/Subdir1/b.h new file mode 100644 index 00000000000..3b3a25f213f --- /dev/null +++ b/clang/test/Modules/Inputs/PR28752/Subdir1/b.h @@ -0,0 +1 @@ +#include diff --git a/clang/test/Modules/Inputs/PR28752/Subdir1/c.h b/clang/test/Modules/Inputs/PR28752/Subdir1/c.h new file mode 100644 index 00000000000..e69de29bb2d diff --git a/clang/test/Modules/Inputs/PR28752/Subdir1/module.modulemap b/clang/test/Modules/Inputs/PR28752/Subdir1/module.modulemap new file mode 100644 index 00000000000..8d3bfe996f5 --- /dev/null +++ b/clang/test/Modules/Inputs/PR28752/Subdir1/module.modulemap @@ -0,0 +1,5 @@ +module b { + module "b.h" { header "b.h" export * } + module "c.h" { header "c.h" export * } + export * +} diff --git a/clang/test/Modules/Inputs/PR28752/a.h b/clang/test/Modules/Inputs/PR28752/a.h new file mode 100644 index 00000000000..3b3a25f213f --- /dev/null +++ b/clang/test/Modules/Inputs/PR28752/a.h @@ -0,0 +1 @@ +#include diff --git a/clang/test/Modules/Inputs/PR28752/module.modulemap b/clang/test/Modules/Inputs/PR28752/module.modulemap new file mode 100644 index 00000000000..caf888fc474 --- /dev/null +++ b/clang/test/Modules/Inputs/PR28752/module.modulemap @@ -0,0 +1 @@ +module a { header "a.h" export * } diff --git a/clang/test/Modules/Inputs/PR28752/vector b/clang/test/Modules/Inputs/PR28752/vector new file mode 100644 index 00000000000..fc5dafae1f9 --- /dev/null +++ b/clang/test/Modules/Inputs/PR28752/vector @@ -0,0 +1,28 @@ +#ifndef VECTOR +#define VECTOR +template struct B; +template struct B { typedef _Tp type; }; +namespace std { +template struct D { + + template struct F { + static const bool value = 0; + }; + + template + typename B::value, _Alloc2>::type _S_select(_Alloc2); + template + static + typename B::value, _Alloc2>::type _S_select(_Alloc2); +}; +template +template +const bool D<_Alloc>::F<_Alloc2>::value; + +template class vector { +public: + vector(int); + vector(vector &) : vector(D::_S_select((bool)0)) {} +}; +} +#endif // VECTOR \ No newline at end of file -- cgit v1.2.3