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

Reid Kleckner rnk at google.com
Wed Sep 25 18:10:19 PDT 2013



================
Comment at: include/clang/Basic/OperatorKinds.h:34-44
@@ +33,13 @@
+
+/// Returns true if the given operator is implicitly static in a record
+/// context.
+inline bool isImplicitlyStaticOperator(OverloadedOperatorKind OOK) {
+  // [class.free]p1:
+  // Any allocation function for a class T is a static member
+  // (even if not explicitly declared static).
+  // [class.free]p6 Any deallocation function for a class X is a static member
+  // (even if not explicitly declared static).
+  return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
+         OOK == OO_Array_Delete;
+}
+
----------------
Doing this here seems wrong.  Any better ideas?  I didn't want to include DeclCXX.h from DeclSpec.h.


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



More information about the cfe-commits mailing list