break;
}
- if (!processing_template_decl
+ if (!value_dependent_expression_p (t)
&& !uid_sensitive_constexpr_evaluation_p ())
r = evaluate_concept_check (t);
else
}
case TEMPLATE_ID_EXPR:
- return concept_definition_p (TREE_OPERAND (expression, 0));
+ return concept_definition_p (TREE_OPERAND (expression, 0))
+ && any_dependent_template_arguments_p (TREE_OPERAND (expression, 1));
case CONSTRUCTOR:
{
case REQUIRES_EXPR:
return *tp;
- case CALL_EXPR:
- /* Treat concept checks as dependent. */
- if (concept_check_p (*tp))
- return *tp;
- break;
-
- case TEMPLATE_ID_EXPR:
- /* Treat concept checks as dependent. */
- if (concept_check_p (*tp))
- return *tp;
- break;
-
case CONSTRUCTOR:
if (CONSTRUCTOR_IS_DEPENDENT (*tp))
return *tp;
--- /dev/null
+// PR c++/102412
+// { dg-do link { target c++20 } }
+
+template<class T, class U> concept C = __is_same(T, U);
+
+template<class T, bool = C<int, T>> void f();
+template<> void f<int, true>() { }
+template<> void f<char, false>() { }
+
+template<bool = C<int, char>> void g();
+template<> void g<false>() { }
+
+template<bool = C<int, int>> void h();
+template<> void h<true>() { }
+
+int main() {
+ f<int>();
+ f<char>();
+ g();
+ h();
+}
--- /dev/null
+// DR 2446
+// { dg-do compile { target c++20 } }
+
+template <typename T> concept C = true;
+template <typename T> struct A;
+template <> struct A<bool> { using type = bool; };
+
+template <typename T>
+void f(A<decltype(C<T>)>::type); // OK, no 'typename' needed