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

Eli Friedman eli.friedman at gmail.com
Wed Sep 25 18:29:28 PDT 2013



================
Comment at: lib/Sema/SemaDecl.cpp:6497
@@ -6497,1 +6496,3 @@
+  }
+
   FunctionTemplateDecl *FunctionTemplate = 0;
----------------
Did you mean to remove the other code which sets isFriend?

================
Comment at: lib/Sema/SemaType.cpp:2452
@@ -2449,2 +2451,3 @@
       IsCXXInstanceMethod =
           (D.getContext() == Declarator::MemberContext &&
+           DS.getStorageClassSpec() != DeclSpec::SCS_typedef &&
----------------
The MemberContext check is redundant.

================
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;
+}
+
----------------
Reid Kleckner wrote:
> Doing this here seems wrong.  Any better ideas?  I didn't want to include DeclCXX.h from DeclSpec.h.
You could sink the isStaticMember() implementation into DeclSpec.cpp.


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



More information about the cfe-commits mailing list