diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -565,6 +565,9 @@ (`#63629 `_) - Fixed parsing of elaborated type specifier inside of a new expression. (`#34341 `_) +- Clang now correctly evaluates ``__has_extension (cxx_defaulted_functions)`` + and ``__has_extension (cxx_default_function_template_args)`` to 1. + (`#61758 `_) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/clang/include/clang/Basic/Features.def b/clang/include/clang/Basic/Features.def --- a/clang/include/clang/Basic/Features.def +++ b/clang/include/clang/Basic/Features.def @@ -247,6 +247,8 @@ EXTENSION(c_thread_local, PP.getTargetInfo().isTLSSupported()) // C++11 features supported by other languages as extensions. EXTENSION(cxx_atomic, LangOpts.CPlusPlus) +EXTENSION(cxx_default_function_template_args, LangOpts.CPlusPlus) +EXTENSION(cxx_defaulted_functions, LangOpts.CPlusPlus) EXTENSION(cxx_deleted_functions, LangOpts.CPlusPlus) EXTENSION(cxx_explicit_conversions, LangOpts.CPlusPlus) EXTENSION(cxx_inline_namespaces, LangOpts.CPlusPlus) diff --git a/clang/test/Lexer/has_extension_cxx.cpp b/clang/test/Lexer/has_extension_cxx.cpp --- a/clang/test/Lexer/has_extension_cxx.cpp +++ b/clang/test/Lexer/has_extension_cxx.cpp @@ -11,6 +11,16 @@ int c_generic_selections(); #endif +// CHECK: has_deleted_functions +#if __has_extension(cxx_default_function_template_args) +int has_deleted_functions(); +#endif + +// CHECK: has_deleted_functions +#if __has_extension(cxx_defaulted_functions) +int has_deleted_functions(); +#endif + // CHECK: has_deleted_functions #if __has_extension(cxx_deleted_functions) int has_deleted_functions();