Skip to content

Commit

Permalink
Add tests for 15802 and 15372
Browse files Browse the repository at this point in the history
  • Loading branch information
Kozzi11 committed Mar 16, 2016
1 parent 548c6d1 commit a2204f8
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/compilable/test15802.d
@@ -0,0 +1,10 @@
extern(C++) {
template Foo(T) {
static int boo();
}
}

void main()
{
string s = Foo!(int).boo.mangleof;
}
28 changes: 28 additions & 0 deletions test/runnable/cppa.d
Expand Up @@ -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()
Expand Down Expand Up @@ -1123,6 +1148,9 @@ void main()
testeh3();
test15579();
test15610();
test15372();
test15802();


printf("Success\n");
}
28 changes: 28 additions & 0 deletions test/runnable/extra-files/cppb.cpp
Expand Up @@ -695,4 +695,32 @@ void Derived2::f()
}

/******************************************/
// 15372

template <typename T>
int foo15372(int value)
{
return value;
}

void test15372b()
{
int t = foo15372<int>(1);
}

/****************************************/
// 15802
template <typename T>
class Foo15802
{
public:
static int boo(int value)
{
return value;
}
};

void test15802b()
{
int t = Foo15802<int>::boo(1);
}

0 comments on commit a2204f8

Please sign in to comment.