Skip to content

Commit

Permalink
Merge pull request #3220 from IgorStepanov/cppmanglewindows3
Browse files Browse the repository at this point in the history
Fix private method C++ mangling
  • Loading branch information
yebblies committed Feb 6, 2014
2 parents 8562789 + b8a3377 commit b690049
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/cppmangle.c
Expand Up @@ -1089,12 +1089,8 @@ class VisualCPPMangler : public Visitor

if (d->needThis()) // <flags> ::= <virtual/protection flag> <const/volatile flag> <calling convention flag>
{

//Pivate methods can be non-virtual in D but mangled as virtual in C++
if ((d->isVirtual() && d->vtblIndex != -1) ||
(d->protection == PROTprivate &&
d->isThis()->isClassDeclaration() &&
!d->isFinal() && !(d->isThis()->isClassDeclaration()->storage_class & STCfinal)))
// Pivate methods always non-virtual in D and it should be mangled as non-virtual in C++
if (d->isVirtual() && d->vtblIndex != -1)
{
switch (d->protection)
{
Expand Down
2 changes: 1 addition & 1 deletion test/runnable/extra-files/externmangle.cpp
Expand Up @@ -100,7 +100,7 @@ class Test10
protected: void test12();
public: void test13() const;

private: virtual void test14();
private: void test14(); // Private methods in D are always non-virtual
public: virtual void test15();
protected: virtual void test16();

Expand Down

0 comments on commit b690049

Please sign in to comment.