diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-06-21 14:00:56 +0000 |
commit | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (patch) | |
tree | a764184c2fc9486979b074250b013a0937ee64e5 /test/Modules/Inputs | |
parent | 798321d8eb5630cd4a8f490a4f25e32ef195fb07 (diff) |
Notes
Diffstat (limited to 'test/Modules/Inputs')
13 files changed, 61 insertions, 2 deletions
diff --git a/test/Modules/Inputs/merge-class-definition-visibility/a.h b/test/Modules/Inputs/merge-class-definition-visibility/a.h new file mode 100644 index 000000000000..4c5cd949f234 --- /dev/null +++ b/test/Modules/Inputs/merge-class-definition-visibility/a.h @@ -0,0 +1 @@ +struct A {}; diff --git a/test/Modules/Inputs/merge-class-definition-visibility/b.h b/test/Modules/Inputs/merge-class-definition-visibility/b.h new file mode 100644 index 000000000000..2b8f5f868ed9 --- /dev/null +++ b/test/Modules/Inputs/merge-class-definition-visibility/b.h @@ -0,0 +1,2 @@ +// Include definition of A into the same module as c.h +#include "a.h" diff --git a/test/Modules/Inputs/merge-class-definition-visibility/c.h b/test/Modules/Inputs/merge-class-definition-visibility/c.h new file mode 100644 index 000000000000..27f503c2c607 --- /dev/null +++ b/test/Modules/Inputs/merge-class-definition-visibility/c.h @@ -0,0 +1 @@ +struct A; diff --git a/test/Modules/Inputs/merge-class-definition-visibility/d.h b/test/Modules/Inputs/merge-class-definition-visibility/d.h new file mode 100644 index 000000000000..2243de1baf9a --- /dev/null +++ b/test/Modules/Inputs/merge-class-definition-visibility/d.h @@ -0,0 +1 @@ +#include "a.h" diff --git a/test/Modules/Inputs/merge-class-definition-visibility/modmap b/test/Modules/Inputs/merge-class-definition-visibility/modmap new file mode 100644 index 000000000000..7d988fbba003 --- /dev/null +++ b/test/Modules/Inputs/merge-class-definition-visibility/modmap @@ -0,0 +1,7 @@ +module Def1 { + module B { header "b.h" } + module C { header "c.h" } +} +module Def2 { + header "d.h" +} diff --git a/test/Modules/Inputs/submodules-merge-defs/defs.h b/test/Modules/Inputs/submodules-merge-defs/defs.h index 68b57a4a62fe..247b05c47082 100644 --- a/test/Modules/Inputs/submodules-merge-defs/defs.h +++ b/test/Modules/Inputs/submodules-merge-defs/defs.h @@ -31,7 +31,7 @@ template<typename T> struct F { template<typename T> int F<T>::f() { return 0; } template<typename T> template<typename U> int F<T>::g() { return 0; } template<typename T> int F<T>::n = 0; -template<> template<typename U> int F<char>::g() { return 0; } +//template<> template<typename U> int F<char>::g() { return 0; } // FIXME: Re-enable this once we support merging member specializations. template<> struct F<void> { int h(); }; inline int F<void>::h() { return 0; } template<typename T> struct F<T *> { int i(); }; @@ -46,3 +46,31 @@ namespace G { template<typename T = int, int N = 3, template<typename> class K = F> int H(int a = 1); template<typename T = int, int N = 3, template<typename> class K = F> using I = decltype(H<T, N, K>()); +template<typename T = int, int N = 3, template<typename> class K = F> struct J {}; + +namespace NS { + struct A {}; + template<typename T> struct B : A {}; + template<typename T> struct B<T*> : B<char> {}; + template<> struct B<int> : B<int*> {}; + inline void f() {} +} + +namespace StaticInline { + struct X {}; + static inline void f(X); + static inline void g(X x) { f(x); } +} + +namespace FriendDefArg { + template<typename = int> struct A; + template<int = 0> struct B; + template<template<typename> class = A> struct C; + template<typename = int, int = 0, template<typename> class = A> struct D {}; + template<typename U> struct Y { + template<typename> friend struct A; + template<int> friend struct B; + template<template<typename> class> friend struct C; + template<typename, int, template<typename> class> friend struct D; + }; +} diff --git a/test/Modules/Inputs/submodules-merge-defs/indirect.h b/test/Modules/Inputs/submodules-merge-defs/indirect.h new file mode 100644 index 000000000000..28baa019b22f --- /dev/null +++ b/test/Modules/Inputs/submodules-merge-defs/indirect.h @@ -0,0 +1 @@ +#include "merged-defs.h" diff --git a/test/Modules/Inputs/submodules-merge-defs/module.modulemap b/test/Modules/Inputs/submodules-merge-defs/module.modulemap index 82abdb088f19..3b5493e2b8bb 100644 --- a/test/Modules/Inputs/submodules-merge-defs/module.modulemap +++ b/test/Modules/Inputs/submodules-merge-defs/module.modulemap @@ -2,6 +2,7 @@ module "stuff" { textual header "defs.h" module "empty" { header "empty.h" } module "use" { header "use-defs.h" } + module "use-2" { requires use_defs_twice header "use-defs-2.h" } } module "redef" { @@ -14,3 +15,8 @@ module "merged-defs" { header "merged-defs.h" use "stuff" } + +module "indirect" { + header "indirect.h" + use "merged-defs" +} diff --git a/test/Modules/Inputs/submodules-merge-defs/use-defs-2.h b/test/Modules/Inputs/submodules-merge-defs/use-defs-2.h new file mode 100644 index 000000000000..a78f08ab0d5d --- /dev/null +++ b/test/Modules/Inputs/submodules-merge-defs/use-defs-2.h @@ -0,0 +1,2 @@ +// use-defs-2.h +#include "defs.h" diff --git a/test/Modules/Inputs/submodules-merge-defs/use-defs.h b/test/Modules/Inputs/submodules-merge-defs/use-defs.h index 31c69c6a447d..2e883760b7a7 100644 --- a/test/Modules/Inputs/submodules-merge-defs/use-defs.h +++ b/test/Modules/Inputs/submodules-merge-defs/use-defs.h @@ -1 +1,2 @@ +// use-defs.h #include "defs.h" diff --git a/test/Modules/Inputs/template-default-args/a.h b/test/Modules/Inputs/template-default-args/a.h index 1ef1ea5907b5..be760fe6f1d5 100644 --- a/test/Modules/Inputs/template-default-args/a.h +++ b/test/Modules/Inputs/template-default-args/a.h @@ -2,3 +2,6 @@ template<typename T = int> struct A {}; template<typename T> struct B {}; template<typename T> struct C; template<typename T> struct D; +template<typename T> struct E; +template<typename T = int> struct G; +template<typename T = int> struct H; diff --git a/test/Modules/Inputs/template-default-args/c.h b/test/Modules/Inputs/template-default-args/c.h new file mode 100644 index 000000000000..2946013b6131 --- /dev/null +++ b/test/Modules/Inputs/template-default-args/c.h @@ -0,0 +1,2 @@ +template<typename T = int> struct F; +template<typename T, typename U> struct I; diff --git a/test/Modules/Inputs/template-default-args/module.modulemap b/test/Modules/Inputs/template-default-args/module.modulemap index 6182e6b3eee1..d54dfc345abf 100644 --- a/test/Modules/Inputs/template-default-args/module.modulemap +++ b/test/Modules/Inputs/template-default-args/module.modulemap @@ -1 +1,5 @@ -module X { module A { header "a.h" } module B { header "b.h" } } +module X { + module A { header "a.h" } + module B { header "b.h" } + module C { header "c.h" } +} |