diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2011-01-27 19:17:54 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2011-01-27 19:17:54 +0000 |
commit | b7ee2e5cc999a45ec4fd7b879477816714aabb7e (patch) | |
tree | 2b58dd1730b74027a41049fe7bc9234a92ba2fa5 /docs | |
parent | 96554fd1aa7350498de8911fb6f303a9262e6ec0 (diff) |
Revert r124217 because it didn't catch the actual error case it was trying to
catch:
lock_guard(my_mutex);
declares a variable instead of creating a temporary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LanguageExtensions.html | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html index b2b3f3cde6..30c85ffcbd 100644 --- a/docs/LanguageExtensions.html +++ b/docs/LanguageExtensions.html @@ -25,7 +25,6 @@ td { <li><a href="#vectors">Vectors and Extended Vectors</a></li> <li><a href="#deprecated">Messages on <tt>deprecated</tt> and <tt>unavailable</tt> attributes</a></li> <li><a href="#attributes-on-enumerators">Attributes on enumerators</a></li> -<li><a href="#forbid-temporaries-attribute">Attribute to forbid temporaries of a type</a></li> <li><a href="#checking_language_features">Checks for Standard Language Features</a></li> <ul> <li><a href="#cxx_exceptions">C++ exceptions</a></li> @@ -343,33 +342,6 @@ individual enumerators.</p> <p>Query for this feature with <tt>__has_feature(enumerator_attributes)</tt>.</p> <!-- ======================================================================= --> -<h2 id="forbid-temporaries-attribute">Attribute to forbid temporaries of a type</h2> -<!-- ======================================================================= --> - -<p>Clang provides a <tt>forbid_temporaries</tt> attribute to forbid -temporaries of a particular type.</p> - -<blockquote> -<pre>class __attribute__((forbid_temporaries)) scoped_lock { - ... -};</pre> -</blockquote> - -<p>This prevents mistakes like</p> - -<blockquote> -<pre>void foo() { - scoped_lock(my_mutex); - // Forgot the local variable name, so destructor runs here. - code_that_needs_lock_held(); - // User expects destructor to run here. -};</pre> -</blockquote> - -<p>Query for this feature with <tt>__has_attribute(forbid_temporaries)</tt>. -Use <tt>-Wno-forbid-temporaries</tt> to disable the resulting warning.</p> - -<!-- ======================================================================= --> <h2 id="checking_language_features">Checks for Standard Language Features</h2> <!-- ======================================================================= --> |