if (TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (templ)) == 1
&& !any_dependent_template_arguments_p (targs))
{
+ /* We may be called while doing a partial substitution, but the
+ type of the variable template may be auto, in which case we
+ will call do_auto_deduction in mark_used (which clears tf_partial)
+ and the auto must be properly reduced at that time for the
+ deduction to work. */
+ complain &= ~tf_partial;
var = finish_template_variable (var, complain);
mark_used (var);
}
--- /dev/null
+// PR c++/108550
+// { dg-do compile { target c++14 } }
+
+template<class T>
+struct is_pointer
+{
+ static constexpr bool value = false;
+};
+
+template<class T, T T1>
+struct integral_constant
+{
+ static constexpr T value = T1;
+};
+
+
+template <class Tp>
+constexpr auto is_pointer_v = is_pointer<Tp>::value;
+
+template <class Tp, int = 0>
+integral_constant<bool, is_pointer_v<int>> Wrap1();
+
+int main() {
+ static_assert(!decltype(Wrap1<int>())::value, "");
+}
--- /dev/null
+// PR c++/108550
+// { dg-do compile { target c++14 } }
+
+template<class T, T T1>
+struct integral_constant
+{
+ static constexpr T value = T1;
+};
+
+template <typename T>
+struct S {
+ template <typename U, typename V>
+ static constexpr void foo(V) { }
+
+ constexpr bool bar () const { foo<int>(10); return false; }
+};
+
+template <class Tp>
+constexpr auto is_pointer_v = S<Tp>{}.bar();
+
+template <class Tp, int = 0>
+integral_constant<bool, is_pointer_v<int>> Wrap1();
+
+int main() {
+ static_assert(!decltype(Wrap1<int>())::value, "");
+}
--- /dev/null
+// PR c++/108550
+// { dg-do compile { target c++14 } }
+
+template<class T>
+struct is_pointer
+{
+ static constexpr bool value = false;
+};
+
+template<class T, T T1>
+struct integral_constant
+{
+ static constexpr T value = T1;
+};
+
+template<typename T>
+using PTR_P = is_pointer<T>;
+
+template <class Tp>
+constexpr auto is_pointer_v = PTR_P<Tp>::value;
+
+template <class Tp, int = 0>
+integral_constant<bool, is_pointer_v<Tp>> Wrap1();
+
+int main() {
+ static_assert(!decltype(Wrap1<int>())::value, "");
+}