Skip to content

Commit

Permalink
Merge pull request #5261 from ibuclaw/issue14956a
Browse files Browse the repository at this point in the history
Parameter types should have namespace std mangling too
  • Loading branch information
dnadlinger committed Feb 13, 2016
2 parents c2c0362 + 95ddb15 commit f9b657b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cppmangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TAR
}
if (p && !p.isModule())
{
prefix_name(p);
if (p.ident == Id.std && is_initial_qualifier(p))
buf.writestring("St");
else
prefix_name(p);
}
if (!(s.ident == Id.std && is_initial_qualifier(s)))
store(s);
Expand Down
12 changes: 12 additions & 0 deletions test/runnable/cppa.d
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,12 @@ extern (C++, std)
}

class exception { }

// 14956
extern(C++, N14956)
{
struct S14956 { }
}
}

extern (C++)
Expand Down Expand Up @@ -759,6 +765,11 @@ void test14200()
test14200b(1.0f, 1, 1.0);
}

/****************************************/
// 14956

extern(C++) void test14956(S14956 s);

/****************************************/
// check order of overloads in vtable

Expand Down Expand Up @@ -1104,6 +1115,7 @@ void main()
foo13337(S13337());
test14195();
test14200();
test14956(S14956());
testVtable();
fuzz();
testeh();
Expand Down
11 changes: 11 additions & 0 deletions test/runnable/extra-files/cppb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,17 @@ void test14195b(Delegate2<int(float, double), int(float, double)> func) {}
void test14200a(int a) {};
void test14200b(float a, int b, double c) {};

/******************************************/
// 14956

namespace std {
namespace N14956 {
struct S14956 { };
}
}

void test14956(std::N14956::S14956 s) { }

/******************************************/
// check order of overloads in vtable

Expand Down

0 comments on commit f9b657b

Please sign in to comment.