Index: styleguide/c++/c++11.html |
diff --git a/styleguide/c++/c++11.html b/styleguide/c++/c++11.html |
index 402e5c958d7387077ee0513de14c0e9ec3b6ad51..cf5378b7efa4915a87b5fa3df5bc24cb55ed41fc 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>alignas / alignof</td> |
+<td><code>alignas(alignof(T)) char[10];</code></td> |
+<td>Queries or specifies 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> |
@@ -610,6 +618,14 @@ 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> |
+ |
+<tr> |
<td>Atomics</td> |
<td><code><atomic></code></td> |
<td>Fine-grained atomic types and operations</td> |
@@ -769,11 +785,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> |