Index: styleguide/c++/c++11.html |
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html |
index d62bf25703ae2f9452ca20261fe9d32938b95466..4fe82713de48f96f997d31bf354a6bcc89cdd231 100644 |
--- a/styleguide/c++/c++11.html |
+++ b/styleguide/c++/c++11.html |
@@ -78,6 +78,14 @@ change this file accordingly, linking to your discussion thread.</p> |
</tr> |
<tr> |
+<td>Alignment Features</td> |
+<td><code>alignas(alignof(T)) char[10];</code></td> |
+<td>Specifies or queries storage alignment.</td> |
+<td><a href="http://en.cppreference.com/w/chttp://en.cppreference.com/w/cpp/language/alignas">alignas</a>, <a href="http://en.cppreference.com/w/cpp/language/alignof">alignof</a></td> |
+<td><code>alignof()</code> can be used. <code>alignas()</code> must be used with care because it does not interact well with export and packing specifiers. If your declaration contains any other attributes, use <code>ALIGNAS()</code> from <code>base/compiler_specific.h</code> instead. <a href="https://codereview.chromium.org/2670873002/">Patch where this was discussed</a></td> |
+</tr> |
+ |
+<tr> |
<td>Angle Bracket Parsing in Templates</td> |
<td><code>>></code> for <code>> ></code>, <code><::</code> for <code>< ::</code></td> |
<td>More intuitive parsing of template parameters</td> |
@@ -618,6 +626,13 @@ std::move(t).f(); // second</code></td> |
</tr> |
<tr> |
+<td>Aligned storage</td> |
+<td><code>std::aligned_storage<10, 128></code></td> |
+<td>Uninitialized storage for objects requiring specific alignment.</td> |
+<td><a href="http://en.cppreference.com/w/cpp/types/aligned_storage">std::aligned_storage</a></td> |
+<td>MSVC 2017's implementation does not align on boundaries greater than sizeof(double) = 8 bytes. Use <code>alignas(128) char foo[10];</code> instead. <a href="https://codereview.chromium.org/2932053002">Patch where this was discovered</a>.</td> |
+</tr> |
+ |
<td>Bind Operations</td> |
<td><code>std::bind(<i>function</i>, <i>args</i>, ...)</code></td> |
<td>Declares a function object bound to certain arguments</td> |
@@ -710,14 +725,6 @@ std::move(t).f(); // second</code></td> |
</tr> |
<tr> |
-<td>Alignment Features</td> |
-<td><code>alignas</code> specifier, <code>alignof</code> operator</td> |
-<td>Object alignment</td> |
-<td><a href="http://en.cppreference.com/w/cpp/language/alignas">alignas specifier</a>, <a href="http://en.cppreference.com/w/cpp/language/alignof">alignof operator</a></td> |
-<td>Reevaluate now that MSVS2015 is available. <a href="https://groups.google.com/a/chromium.org/forum/#!topic/cxx/rwXN02jzzq0">Discussion thread</a></td> |
-</tr> |
- |
-<tr> |
<td>Attributes</td> |
<td><code>[[<i>attribute_name</i>]]</code></td> |
<td>Attaches properties to declarations that specific compiler implementations may use.</td> |
@@ -769,11 +776,10 @@ std::move(t).f(); // second</code></td> |
<tr> |
<td>Aligned Storage</td> |
-<td><code>std::aligned_storage<Size, Align>::type</code><br /> |
-<code>std::alignment_of<T></code>, <code>std::aligned_union<Size, ...Types></code> <code>std::max_align_t</code></td> |
+<td><code>std::alignment_of<T></code>, <code>std::aligned_union<Size, ...Types></code> <code>std::max_align_t</code></td> |
<td>Declare uninitialized storage having a specified alignment, or determine alignments.</td> |
-<td><a href="http://en.cppreference.com/w/cpp/types/aligned_storage">std::aligned_storage</a></td> |
-<td><code>std::aligned_storage</code> and <code>std::aligned_union</code> are disallowed in google3 over concerns about compatibility with internal cross-compiling toolchains.</td> |
+<td><a href="http://en.cppreference.com/w/cpp/types/aligned_union">std::aligned_union</a></td> |
+<td><code>std::aligned_union</code> is disallowed in google3 over concerns about compatibility with internal cross-compiling toolchains. <code>std::aligned_storage</code> is on the disallowed list due to compatibility concerns.</td> |
</tr> |
<tr> |