[PATCH] [ms-cxxabi] Fix the calling convention for operator new in records

Richard Smith richard at metafoo.co.uk
Mon Oct 7 15:56:23 PDT 2013


  So... the name `isMember` is still not really correct. I think you're going for `isFirstDeclarationOfMemberFunction`, maybe?


================
Comment at: include/clang/Sema/DeclSpec.h:2084
@@ +2083,3 @@
+    return getContext() == MemberContext &&
+           getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef &&
+           !getDeclSpec().isFriendSpecified();
----------------
A typedef declaration is a member.

================
Comment at: include/clang/Sema/DeclSpec.h:2083
@@ +2082,3 @@
+  bool isMember() {
+    return getContext() == MemberContext &&
+           getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef &&
----------------
If we have a nested name specifier that names a class, then we are declaring a record member.

================
Comment at: test/CodeGenCXX/mangle-ms.cpp:340-348
@@ +339,11 @@
+
+typedef void *__thiscall OperatorNewType(__SIZE_TYPE__);
+typedef void __thiscall OperatorDeleteType(void *);
+
+struct TypedefNewDelete {
+  OperatorNewType operator new;
+  OperatorNewType operator new[];
+  OperatorDeleteType operator delete;
+  OperatorDeleteType operator delete[];
+};
+
----------------
*blink* Yuck.


http://llvm-reviews.chandlerc.com/D1761



More information about the cfe-commits mailing list