public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-6554] c++: hide __is_deducible for GCC 13
@ 2023-03-09 15:27 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2023-03-09 15:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:30556bf81f4385c2a9c449948865dbcf35664764

commit r13-6554-g30556bf81f4385c2a9c449948865dbcf35664764
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Mar 8 23:53:21 2023 -0500

    c++: hide __is_deducible for GCC 13
    
    I want to have more discussion about the interface before claiming the
    __is_deducible name, so for GCC 13 make it internal-only.
    
    gcc/ChangeLog:
    
            * doc/extend.texi: Comment out __is_deducible docs.
    
    gcc/cp/ChangeLog:
    
            * cp-trait.def (IS_DEDUCIBLE): Add space to name.
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/ext/is_deducible1.C: Guard with
            __has_builtin (__is_deducible).

Diff:
---
 gcc/doc/extend.texi                      | 7 ++++---
 gcc/testsuite/g++.dg/ext/is_deducible1.C | 6 +++++-
 gcc/cp/cp-trait.def                      | 3 ++-
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index b64a85722db..9dcfc860108 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -25213,9 +25213,10 @@ type.  A diagnostic is produced if this requirement is not met.
 If @code{type} is a cv-qualified class type, and not a union type
 ([basic.compound]) the trait is @code{true}, else it is @code{false}.
 
-@item __is_deducible (template, type)
-If template arguments for @code{template} can be deduced from
-@code{type} or obtained from default template arguments.
+@c FIXME Commented out for GCC 13, discuss user interface for GCC 14.
+@c @item __is_deducible (template, type)
+@c If template arguments for @code{template} can be deduced from
+@c @code{type} or obtained from default template arguments.
 
 @item __is_empty (type)
 If @code{__is_class (type)} is @code{false} then the trait is @code{false}.
diff --git a/gcc/testsuite/g++.dg/ext/is_deducible1.C b/gcc/testsuite/g++.dg/ext/is_deducible1.C
index 30cbe089f50..6873e4f4c2e 100644
--- a/gcc/testsuite/g++.dg/ext/is_deducible1.C
+++ b/gcc/testsuite/g++.dg/ext/is_deducible1.C
@@ -1,5 +1,7 @@
 // { dg-do compile { target c++20 } }
 
+#if __has_builtin (__is_deducible)
+
 template <class T> struct A { };
 template <class T> struct B { };
 
@@ -26,6 +28,8 @@ static_assert (__is_deducible (D, D<int>));
 template <class T, T N> using E = int[N];
 static_assert (__is_deducible (E, int[42]));
 
+#endif // __has_builtin (__is_deducible)
+
 // We don't try to support this.
 template <class T> void f(T);
-bool b = __is_deducible (f, void (int)); // { dg-error "class or alias" }
+bool b = __is_deducible (f, void (int)); // { dg-error "" }
diff --git a/gcc/cp/cp-trait.def b/gcc/cp/cp-trait.def
index e43fb464f42..bac593c0094 100644
--- a/gcc/cp/cp-trait.def
+++ b/gcc/cp/cp-trait.def
@@ -84,7 +84,8 @@ DEFTRAIT_EXPR (IS_TRIVIALLY_COPYABLE, "__is_trivially_copyable", 1)
 DEFTRAIT_EXPR (IS_UNION, "__is_union", 1)
 DEFTRAIT_EXPR (REF_CONSTRUCTS_FROM_TEMPORARY, "__reference_constructs_from_temporary", 2)
 DEFTRAIT_EXPR (REF_CONVERTS_FROM_TEMPORARY, "__reference_converts_from_temporary", 2)
-DEFTRAIT_EXPR (IS_DEDUCIBLE, "__is_deducible", 2)
+/* FIXME Added space to avoid direct usage in GCC 13.  */
+DEFTRAIT_EXPR (IS_DEDUCIBLE, "__is_deducible ", 2)
 
 DEFTRAIT_TYPE (REMOVE_CV, "__remove_cv", 1)
 DEFTRAIT_TYPE (REMOVE_REFERENCE, "__remove_reference", 1)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-09 15:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 15:27 [gcc r13-6554] c++: hide __is_deducible for GCC 13 Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).