orig_fn = fn;
+ if (concept_check_p (fn))
+ {
+ error_at (EXPR_LOC_OR_LOC (fn, input_location),
+ "cannot call a concept as a function");
+ return error_mark_node;
+ }
+
if (processing_template_decl)
{
/* If FN is a local extern declaration (or set thereof) in a template,
/*fn_p=*/NULL,
complain);
}
- else if (concept_check_p (fn))
- {
- error_at (EXPR_LOC_OR_LOC (fn, input_location),
- "cannot call a concept as a function");
- return error_mark_node;
- }
else if (is_overloaded_fn (fn))
{
/* If the function is an overloaded builtin, resolve it. */
--- /dev/null
+// { dg-do compile { target c++20 } }
+
+template <typename T>
+concept my_concept = true;
+
+template <typename G>
+void run () {
+ my_concept<G> (G{}); // { dg-error "cannot call a concept as a function" }
+}