[cfe-commits] r143411 - in /cfe/trunk: docs/LanguageExtensions.html lib/Lex/PPMacroExpansion.cpp test/Lexer/has_feature_cxx0x.cpp
Douglas Gregor
dgregor at apple.com
Mon Oct 31 18:19:34 PDT 2011
Author: dgregor
Date: Mon Oct 31 20:19:34 2011
New Revision: 143411
URL: http://llvm.org/viewvc/llvm-project?rev=143411&view=rev
Log:
Add __has_feature(cxx_defaulted_functions) for querying "defaulted
functions", from Michel Morin!
Modified:
cfe/trunk/docs/LanguageExtensions.html
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
cfe/trunk/test/Lexer/has_feature_cxx0x.cpp
Modified: cfe/trunk/docs/LanguageExtensions.html
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.html?rev=143411&r1=143410&r2=143411&view=diff
==============================================================================
--- cfe/trunk/docs/LanguageExtensions.html (original)
+++ cfe/trunk/docs/LanguageExtensions.html Mon Oct 31 20:19:34 2011
@@ -46,6 +46,7 @@
<li><a href="#cxx_constexpr">C++11 generalized constant expressions</a></li>
<li><a href="#cxx_decltype">C++11 <tt>decltype()</tt></a></li>
<li><a href="#cxx_default_function_template_args">C++11 default template arguments in function templates</a></li>
+ <li><a href="#cxx_defaulted_functions">C++11 defaulted functions</a></li>
<li><a href="#cxx_delegating_constructor">C++11 delegating constructors</a></li>
<li><a href="#cxx_deleted_functions">C++11 deleted functions</a></li>
<li><a href="#cxx_explicit_conversions">C++11 explicit conversion functions</a></li>
@@ -509,6 +510,12 @@
<tt>__has_extension(cxx_default_function_template_args)</tt> to determine
if support for default template arguments in function templates is enabled.</p>
+<h4 id="cxx_defaulted_functions">C++11 <tt>default</tt>ed functions</h4>
+
+<p>Use <tt>__has_feature(cxx_defaulted_functions)</tt> or
+<tt>__has_extension(cxx_defaulted_functions)</tt> to determine if support for
+defaulted function definitions (with <tt>= default</tt>) is enabled.</p>
+
<h4 id="cxx_delegating_constructors">C++11 delegating constructors</h4>
<p>Use <tt>__has_feature(cxx_delegating_constructors)</tt> to determine if
Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=143411&r1=143410&r2=143411&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Mon Oct 31 20:19:34 2011
@@ -628,6 +628,7 @@
//.Case("cxx_constexpr", false);
.Case("cxx_decltype", LangOpts.CPlusPlus0x)
.Case("cxx_default_function_template_args", LangOpts.CPlusPlus0x)
+ .Case("cxx_defaulted_functions", LangOpts.CPlusPlus0x)
.Case("cxx_delegating_constructors", LangOpts.CPlusPlus0x)
.Case("cxx_deleted_functions", LangOpts.CPlusPlus0x)
.Case("cxx_explicit_conversions", LangOpts.CPlusPlus0x)
Modified: cfe/trunk/test/Lexer/has_feature_cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/has_feature_cxx0x.cpp?rev=143411&r1=143410&r2=143411&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/has_feature_cxx0x.cpp (original)
+++ cfe/trunk/test/Lexer/has_feature_cxx0x.cpp Mon Oct 31 20:19:34 2011
@@ -79,6 +79,14 @@
// CHECK-0X: has_deleted_functions
// CHECK-NO-0X: no_deleted_functions
+#if __has_feature(cxx_defaulted_functions)
+int has_defaulted_functions();
+#else
+int no_defaulted_functions();
+#endif
+
+// CHECK-0X: has_defaulted_functions
+// CHECK-NO-0X: no_defaulted_functions
#if __has_feature(cxx_rvalue_references)
int has_rvalue_references();
More information about the cfe-commits
mailing list