diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/cp-trait.def | 3 | ||||
-rw-r--r-- | gcc/doc/extend.texi | 7 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/is_deducible1.C | 6 |
3 files changed, 11 insertions, 5 deletions
diff --git a/gcc/cp/cp-trait.def b/gcc/cp/cp-trait.def index e43fb46..bac593c 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) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index b64a857..9dcfc86 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 30cbe08..6873e4f 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 "" } |