[PATCH] fix MergeFunctionDecl implicit CC for static methods

Alexander Zinenko ftynse at gmail.com
Wed Feb 20 09:43:04 PST 2013


clang -cc1 -cxx-abi microsoft -triple i686-pc-win32 as of now behaves as follows

class A {
 public:
  static void foo();
};

void __cdecl A::foo() {}  // Error
void __thiscall A::foo() {}  // OK

__thiscall is invalid for non-instance methods, though. And __cdecl is
an implicit default.

The problem is in MergeFunctionDecl: New function decl doesn't have
information about static storage duration yet, only the Old one,
therefore wrong default CC is checked.

The patch also adds a test for implicit calling convention
compatibility in declarations.

Please review!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130220/a9400750/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: decl.patch
Type: application/octet-stream
Size: 5413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130220/a9400750/attachment.obj>


More information about the llvm-commits mailing list