Skip to content

Commit 5fd9e1f

Browse files
committed
Add a failing testcase where the template arguments of the return type f fail to be deduced
from the rhs of the type alias. This is a FIXME for implementing "If deduction fails for another reason, proceed with an empty set of deduced template arguments."
1 parent f091991 commit 5fd9e1f

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

clang/test/SemaCXX/cxx20-ctad-type-alias.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,26 @@ struct container {
4040

4141
template<class T> using vector = container<T, int>;
4242
vector v(0, 0);
43-
} // namespace test3
43+
} // namespace test3
44+
45+
46+
namespace test4 {
47+
template<class T>
48+
struct X
49+
{
50+
T t;
51+
X(T) {}
52+
};
53+
54+
template <class T>
55+
X(T) -> X<double>;
56+
57+
template <class T>
58+
using AX = X<T>;
59+
60+
void test1() {
61+
AX s = {1};
62+
// FIXME: should select X<double> deduction guide
63+
// static_assert(__is_same(decltype(s.t), double));
64+
}
65+
}

0 commit comments

Comments
 (0)