/* Strip implicit conversions and implicit INDIRECT_REFs. */
while (CONVERT_EXPR_P (expr)
|| TREE_CODE (expr) == VIEW_CONVERT_EXPR
+ || (TREE_CODE (expr) == IMPLICIT_CONV_EXPR
+ && IMPLICIT_CONV_EXPR_FORCED (expr))
|| REFERENCE_REF_P (expr))
expr = TREE_OPERAND (expr, 0);
return (TREE_CODE (expr) == TEMPLATE_PARM_INDEX);
signedness is the only information lost, and I think that will be
okay. VIEW_CONVERT_EXPR can appear with class NTTP, thanks to
finish_id_expression_1, and are also OK. */
- while (CONVERT_EXPR_P (parm) || TREE_CODE (parm) == VIEW_CONVERT_EXPR)
+ while (CONVERT_EXPR_P (parm) || TREE_CODE (parm) == VIEW_CONVERT_EXPR
+ || (TREE_CODE (parm) == IMPLICIT_CONV_EXPR
+ && IMPLICIT_CONV_EXPR_FORCED (parm)))
parm = TREE_OPERAND (parm, 0);
if (arg == error_mark_node)
--- /dev/null
+// PR c++/116223
+// { dg-do compile { target c++17 } }
+
+template <int T> struct A { int value = T; };
+
+template <unsigned char X> using B = A<X>;
+
+template <auto X>
+void foo(B<X>& mat) noexcept
+{
+ // std::cout << mat.value << "\n";
+}
+
+int main()
+{
+ A<2> mat;
+ foo(mat);
+}