https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98768
Bug ID: 98768 Summary: Improve diagnostics for incorrect result type checking "-> Type" in concepts Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: antoshkka at gmail dot com Target Milestone: --- Consider the example: template <typename Function, typename T> concept Callable0Arg = requires(Function func) { func() -> T; }; The expression "-> T" is valid only if the "func()" returns pointer to a type that has member "T". At the same time there is an unused "typename T" in the concept definition. For such cases a warning like "Unused `T` in concept definition. Did you mean `-> std::same_as<T>`" would be really helpful.