[PATCH] D15267: For MS ABI, emit dllexport friend functions defined inline in class

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 27 08:41:10 PST 2016

rnk added inline comments.

Comment at: include/clang/AST/ASTConsumer.h:58-64
@@ -57,5 +57,9 @@
   /// \brief This callback is invoked each time an inline method definition is
   /// completed.
   virtual void HandleInlineMethodDefinition(CXXMethodDecl *D) {}
+  /// \brief This callback is invoked each time an inline friend function
+  /// definition is completed.
+  virtual void HandleInlineFriendFunctionDefinition(FunctionDecl *D) {}
I'm pretty sure we can relax HandleInlineMethodDefinition to take a FunctionDecl and then we don't need the extra AST consumer callback.

Comment at: lib/Parse/ParseCXXInlineMethods.cpp:568-569
@@ -567,2 +567,4 @@
+  else if (auto *FD = dyn_cast_or_null<FunctionDecl>(LM.D))
+    Actions.ActOnFinishInlineFriendFunctionDef(FD);
I'd check for the friend specification here rather than asserting later. There probably are or will eventually be ways to sneak a non-friend, non-method FunctionDecl into a class context.


More information about the cfe-commits mailing list