On Wed, Dec 13, 2023 at 08:48:49PM -0500, Jason Merrill wrote: > On 11/27/23 10:58, Patrick Palka wrote: > > gcc/cp/ChangeLog: > > > > * cp-tree.h (type_targs_deducible_from): Adjust return type. > > * pt.cc (alias_ctad_tweaks): Handle C++23 inherited CTAD. > > (inherited_ctad_tweaks): Define. > > (type_targs_deducible_from): Return the deduced arguments or > > NULL_TREE instead of a bool. Handle 'tmpl' being a TREE_LIST > > representing a synthetic alias template. > > (ctor_deduction_guides_for): Do inherited_ctad_tweaks for each > > USING_DECL in C++23 mode. > > (deduction_guides_for): Add FIXME for stale cache entries in > > light of inherited CTAD. > > check_GNU_style.py notices a few too-long lines in comments: > > > === ERROR type #2: lines should not exceed 80 characters (3 error(s)) === > > gcc/cp/pt.cc:30076:80: /* FIXME this should mean they > > don't compare as equivalent. */ > > gcc/cp/pt.cc:30138:80: class template TMPL; adjust the base's guides be > > deduction guides for TMPL. */ > > gcc/cp/pt.cc:30190:80: /* If tmpl is a class template, this is > > trivial: it's deducible if TYPE is a > > OK with those fixed. > > index 4624794c4b7..74f92325d7a 100644 > > --- a/gcc/testsuite/g++.dg/cpp1z/class-deduction67.C > > +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction67.C > > @@ -1,5 +1,4 @@ > > -// Deduction from inherited constructors isn't supported yet, but we > > shouldn't > > -// crash. It may well be supported in C++23. > > +// Deduction from inherited constructors isn't supported before C++23. > > //{ dg-do compile { target c++17 } } > > @@ -17,5 +16,5 @@ int main() > > { > > B b = 42; // { dg-line init } > > // { dg-prune-output "no matching function" } > > - // { dg-error "class template argument deduction" "" { target *-*-* } > > init } > > + // { dg-error "class template argument deduction" "" { target c++23_down > > } init } > > }
I checked in this patch: -- >8 -- The test says that CTAD from inherited constructors doesn't work before C++23 so we should use c++20_down for the error. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/class-deduction67.C: Correct dg-error target. --- gcc/testsuite/g++.dg/cpp1z/class-deduction67.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction67.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction67.C index 74f92325d7a..fa1523d99d5 100644 --- a/gcc/testsuite/g++.dg/cpp1z/class-deduction67.C +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction67.C @@ -16,5 +16,5 @@ int main() { B b = 42; // { dg-line init } // { dg-prune-output "no matching function" } - // { dg-error "class template argument deduction" "" { target c++23_down } init } + // { dg-error "class template argument deduction" "" { target c++20_down } init } } base-commit: e5e1999aa664333f766f3e6cc6996f769d50ae7a -- 2.43.0