diff --git a/test/compilable/test15802.d b/test/compilable/test15802.d new file mode 100644 index 000000000000..9566eab6d9b6 --- /dev/null +++ b/test/compilable/test15802.d @@ -0,0 +1,10 @@ +extern(C++) { + template Foo(T) { + static int boo(); + } +} + +void main() +{ + string s = Foo!(int).boo.mangleof; +} diff --git a/test/runnable/cppa.d b/test/runnable/cppa.d index 80371a2edb0d..08749ab943c3 100644 --- a/test/runnable/cppa.d +++ b/test/runnable/cppa.d @@ -1084,6 +1084,31 @@ void test15610() c.f(); } +/****************************************/ +// 15372 + +extern(C++) int foo15372(T)(T v); + +void test15372() +{ + assert(foo15372!int(1) == 1); +} + +/****************************************/ +// 15802 + +extern(C++) { + template Foo15802(T) { + static int boo(T v); + } +} + +void test15802() +{ + assert(Foo15802!(int).boo(1) == 1); +} + + /****************************************/ void main() @@ -1123,6 +1148,8 @@ void main() testeh3(); test15579(); test15610(); + test15372(); + test15802(); printf("Success\n"); } diff --git a/test/runnable/extra-files/cppb.cpp b/test/runnable/extra-files/cppb.cpp index 4ce847e90bd3..e948ad359613 100644 --- a/test/runnable/extra-files/cppb.cpp +++ b/test/runnable/extra-files/cppb.cpp @@ -695,4 +695,32 @@ void Derived2::f() } /******************************************/ +// 15372 +template +int foo15372(int value) +{ + return value; +} + +void test15372b() +{ + int t = foo15372(1); +} + +/****************************************/ +// 15802 +template +class Foo15802 +{ +public: + static int boo(int value) + { + return value; + } +}; + +void test15802b() +{ + int t = Foo15802::boo(1); +}