With inherited CTAD the set of guides may be a two-dimensional overload
set (i.e. OVERLOADs of OVERLOADs) so alias_ctad_tweaks (which also does
the inherited CTAD transformation) needs to use the 2D-aware lkp_iterator
instead of ovl_iterator, or better yet use the more idiomatic lkp_range.
PR c++/119687
gcc/cp/ChangeLog:
* pt.cc (alias_ctad_tweaks): Use lkp_range / lkp_iterator
instead of ovl_iterator.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/class-deduction-inherited8.C: New test.
Reviewed-by: Jason Merill <jason@redhat.com>
tree aguides = NULL_TREE;
tree atparms = INNERMOST_TEMPLATE_PARMS (fullatparms);
unsigned natparms = TREE_VEC_LENGTH (atparms);
- for (ovl_iterator iter (uguides); iter; ++iter)
+ for (tree f : lkp_range (uguides))
{
- tree f = *iter;
tree in_decl = f;
location_t loc = DECL_SOURCE_LOCATION (f);
tree ret = TREE_TYPE (TREE_TYPE (f));
--- /dev/null
+// PR c++/119687
+// { dg-do compile { target c++17 } }
+
+template <typename> class QFlagsStorage{};
+
+template <typename Enum> struct QFlagsStorageHelper : QFlagsStorage<Enum> {
+ using QFlagsStorage<Enum>::QFlagsStorage;
+
+public:
+ QFlagsStorageHelper(Enum);
+};
+
+template <typename Enum> struct QFlags : public QFlagsStorageHelper<Enum> {
+ using Base = QFlagsStorageHelper<Enum>;
+ using Base::Base;
+ QFlags(Enum);
+};
+
+void f(int flag) {
+ QFlags{int{}};
+}