From: Douglas Gregor
Use __has_feature(cxx_attributes) to determine if support for attribute parsing with C++0x's square bracket notation is enabled.
+Use __has_feature(cxx_default_function_template_args) to determine if support for default template arguments in function templates is enabled.
+Use __has_feature(cxx_deleted_functions) to determine if support for diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 4a719cac6c..cc294ee266 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -555,6 +555,7 @@ static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) { .Case("cxx_attributes", LangOpts.CPlusPlus0x) //.Case("cxx_auto_type", false) .Case("cxx_decltype", LangOpts.CPlusPlus0x) + .Case("cxx_default_function_template_args", LangOpts.CPlusPlus0x) .Case("cxx_deleted_functions", LangOpts.CPlusPlus0x) .Case("cxx_inline_namespaces", LangOpts.CPlusPlus0x) //.Case("cxx_lambdas", false) diff --git a/test/Lexer/has_feature_cxx0x.cpp b/test/Lexer/has_feature_cxx0x.cpp index 2944ae374c..21950148cf 100644 --- a/test/Lexer/has_feature_cxx0x.cpp +++ b/test/Lexer/has_feature_cxx0x.cpp @@ -109,3 +109,12 @@ int no_reference_qualified_functions(); // CHECK-0X: has_reference_qualified_functions // CHECK-NO-0X: no_reference_qualified_functions +#if __has_feature(cxx_default_function_template_args) +int has_default_function_template_args(); +#else +int no_default_function_template_args(); +#endif + +// CHECK-0X: has_default_function_template_args +// CHECK-NO-0X: no_default_function_template_args +