[PATCH] Avoid std::function until PR19030 is fixed

Reid Kleckner rnk at google.com
Mon Mar 3 12:01:19 PST 2014


We'd like to keep the clang-cl self-host working until we implement
MSVC-compatible RTTI.

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

Files:
  docs/CodingStandards.rst

Index: docs/CodingStandards.rst
===================================================================
--- docs/CodingStandards.rst
+++ docs/CodingStandards.rst
@@ -753,6 +753,17 @@
   // Remove the reference if you really want a new copy.
   for (auto Val : Container) { Val.change(); saveSomewhere(Val); }
 
+Do not use std::function
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Using ``std::function`` breaks self-hosting Clang on Windows with the Microsoft
+Visual C++ STL.  MSVC's implementation of ``std::function`` requires RTTI, and
+Clang does not implement `MSVC-compatible RTTI`_ yet.  Generally, any local use
+of ``std::function`` can be replaced with ``auto``.  For code that truly needs
+an opaque function, use something else for the meantime.
+
+.. _MSVC-style RTTI: http://llvm.org/PR18951
+
 Style Issues
 ============
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2930.1.patch
Type: text/x-patch
Size: 821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140303/fe32318a/attachment.bin>


More information about the llvm-commits mailing list