以下案例是新的 C++ 概念标准的问题吗?

Is the following case an issue with the new C++ concept standard?

考虑这个使用 curiously recurring template pattern:

的程序
template <typename T>
concept Frobulates = requires (T t) { t.frobulate(); };

template <typename Derived>
struct S {
    int sidefumble() requires Frobulates<Derived> {
        Derived::frobulate();
    }
};

struct K: public S<K> {
    void frobulate() {}
};

int main() {
    K k;
    k.sidefumble();
}

编译时,它使用 clang++ 版本 13.0.0 生成此错误:

$ clang13 -std=c++20 ./recurring-concept.cpp -o recurring-concept && ./recurring-concept
./recurring-concept.cpp:17:7: error: invalid reference to function 'sidefumble': constraints not satisfied
    k.sidefumble();
      ^
./recurring-concept.cpp:6:31: note: because 'K' does not satisfy 'Frobulates'
    int sidefumble() requires Frobulates<Derived> {
                              ^
./recurring-concept.cpp:2:41: note: because 't.frobulate()' would be invalid: no member named 'frobulate' in 'K'
concept Frobulates = requires (T t) { t.frobulate(); };
                                        ^
1 error generated.

具体来说,编译器报告类型 K 没有成员 frobulate(),但这显然是错误的。

我希望 sidefumble() 是可编译的,就像 requires 语句不存在时一样。

看起来这是一个错误。

虽然 (感谢@T.C。)似乎概述了略有不同的场景,但潜在的错误似乎是相同的。

This comment in a clang bug thread 包含几乎完全相同的重现。